Commit f8240b6f authored by Rafaël Carré's avatar Rafaël Carré

taglib: Supports in ogg/vorbis base64 encoded embedded album art with...

taglib: Supports in ogg/vorbis base64 encoded embedded album art with COVERARTMIME & COVERART comments.
    Use TagLib namespace for better code readability.

demuxers: Adds attachments support for ogg.
    Fix potential memleaks.
parent adccbca6
......@@ -273,8 +273,10 @@ int E_(OpenDemux)( vlc_object_t *p_this )
p_demux_meta->p_meta );
vlc_meta_Delete( p_demux_meta->p_meta );
module_Unneed( p_demux, p_meta );
TAB_CLEAN( p_demux_meta->i_attachments,
p_demux_meta->attachments );
int i;
for( i = 0; i < p_demux_meta->i_attachments; i++ )
free( p_demux_meta->attachments[i] );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
}
vlc_object_release( p_input );
free( p_demux->p_private );
......
......@@ -197,6 +197,9 @@ static int Open( vlc_object_t * p_this )
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
p_sys->p_meta = p_demux_meta->p_meta;
module_Unneed( p_demux, p_id3 );
int i;
for( i = 0; i < p_demux_meta->i_attachments; i++ )
free( p_demux_meta->attachments[i] );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
}
free( p_demux->p_private );
......
......@@ -119,6 +119,9 @@ static int Open( vlc_object_t * p_this )
p_sys->meta = p_demux_meta->p_meta;
p_demux->p_private = NULL;
module_Unneed( p_demux, p_id3 );
int i;
for( i = 0; i < p_demux_meta->i_attachments; i++ )
free( p_demux_meta->attachments[i] );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
}
free( p_demux->p_private );
......
......@@ -103,6 +103,10 @@ struct demux_sys_t
/* bitrate */
int i_bitrate;
/* attachments */
int i_attachments;
input_attachment_t **attachments;
};
/* OggDS headers for the new header format (used in ogm files) */
......@@ -221,7 +225,8 @@ static int Open( vlc_object_t * p_this )
p_demux_meta->p_meta );
vlc_meta_Delete( p_demux_meta->p_meta );
module_Unneed( p_demux, p_meta );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
p_sys->i_attachments = p_demux_meta->i_attachments;
p_sys->attachments = p_demux_meta->attachments;
}
vlc_object_release( p_input );
free( p_demux->p_private );
......@@ -246,6 +251,11 @@ static void Close( vlc_object_t *p_this )
Ogg_EndOfStream( p_demux );
int i;
for( i = 0; i < p_sys->i_attachments; i++ )
free( p_sys->attachments[i] );
TAB_CLEAN( p_sys->i_attachments, p_sys->attachments);
free( p_sys );
}
......@@ -391,6 +401,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
demux_sys_t *p_sys = p_demux->p_sys;
int64_t *pi64;
int i;
input_attachment_t ***ppp_attach;
int *pi_int;
switch( i_query )
{
......@@ -415,6 +427,20 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
}
ogg_sync_reset( &p_sys->oy );
case DEMUX_GET_ATTACHMENTS:
ppp_attach =
(input_attachment_t***)va_arg( args, input_attachment_t*** );
pi_int = (int*)va_arg( args, int * );
if( p_sys->i_attachments <= 0 )
return VLC_EGENERIC;
*pi_int = p_sys->i_attachments;
*ppp_attach = malloc( sizeof(input_attachment_t**) * p_sys->i_attachments );
for( i = 0; i < p_sys->i_attachments; i++ )
(*ppp_attach)[i] = vlc_input_attachment_Duplicate( p_sys->attachments[i] );
return VLC_SUCCESS;
default:
return demux2_vaControlHelper( p_demux->s, 0, -1, p_sys->i_bitrate,
1, i_query, args );
......
......@@ -150,6 +150,9 @@ static int Open( vlc_object_t * p_this )
p_sys->p_meta = p_demux_meta->p_meta;
p_demux->p_private = NULL;
module_Unneed( p_demux, p_id3 );
int i;
for( i = 0; i < p_demux_meta->i_attachments; i++ )
free( p_demux_meta->attachments[i] );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
}
free( p_demux->p_private );
......
This diff is collapsed.
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