Commit b514a038 authored by Laurent Aimar's avatar Laurent Aimar

Fixed taglib attachment extraction.

C++ is always so much fun ;)
parent 06224b1c
...@@ -204,7 +204,6 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t* ...@@ -204,7 +204,6 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
input_attachment_t *p_attachment; input_attachment_t *p_attachment;
const char *psz_mime; const char *psz_mime;
const char *p_data; int i_data;
char *psz_name, *psz_description; char *psz_name, *psz_description;
// Get the mime and description of the image. // Get the mime and description of the image.
...@@ -234,17 +233,19 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t* ...@@ -234,17 +233,19 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
continue; continue;
} }
p_data = p_apic->picture().data(); const ByteVector picture = p_apic->picture();
i_data = p_apic->picture().size(); const char *p_data = picture.data();
const unsigned i_data = picture.size();
msg_Dbg( p_demux, "Found embedded art: %s (%s) is %i bytes", msg_Dbg( p_demux, "Found embedded art: %s (%s) is %u bytes",
psz_name, psz_mime, i_data ); psz_name, psz_mime, i_data );
p_attachment = vlc_input_attachment_New( psz_name, psz_mime, p_attachment = vlc_input_attachment_New( psz_name, psz_mime,
psz_description, p_data, i_data ); psz_description, p_data, i_data );
TAB_APPEND_CAST( (input_attachment_t**), if( p_attachment )
p_demux_meta->i_attachments, p_demux_meta->attachments, TAB_APPEND_CAST( (input_attachment_t**),
p_attachment ); p_demux_meta->i_attachments, p_demux_meta->attachments,
p_attachment );
free( psz_description ); free( psz_description );
if( pi_cover_score[p_apic->type()] > i_score ) if( pi_cover_score[p_apic->type()] > i_score )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment