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

Demuxers: do not load "meta reader" module if the input item has already been preparsed.

parent eff0d355
......@@ -258,6 +258,8 @@ int E_(OpenDemux)( vlc_object_t *p_this )
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
......@@ -278,9 +280,10 @@ int E_(OpenDemux)( vlc_object_t *p_this )
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 );
}
vlc_object_release( p_input );
}
return VLC_SUCCESS;
}
......
......@@ -155,9 +155,17 @@ static int Open( vlc_object_t * p_this )
}
/* Parse possible id3 header */
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
{
vlc_object_release( p_input );
return VLC_ENOMEM;
}
if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
{
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
......@@ -179,10 +187,13 @@ static int Open( vlc_object_t * p_this )
TAB_APPEND_CAST( (input_attachment_t**),
p_sys->i_attachments, p_sys->attachments,
p_demux_meta->attachments[p_demux_meta->i_attachments] );
TAB_CLEAN( p_demux_meta->i_attachments, p_demux_meta->attachments );
TAB_CLEAN( p_demux_meta->i_attachments,
p_demux_meta->attachments );
}
free( p_demux->p_private );
}
vlc_object_release( p_input );
}
if( p_sys->i_cover_idx < p_sys->i_attachments )
{
......
......@@ -189,9 +189,17 @@ static int Open( vlc_object_t * p_this )
}
/* Parse possible id3 header */
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
{
vlc_object_release( p_input );
return VLC_ENOMEM;
}
if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
{
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
......@@ -200,9 +208,13 @@ static int Open( vlc_object_t * p_this )
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 );
TAB_CLEAN( p_demux_meta->i_attachments,
p_demux_meta->attachments );
}
free( p_demux->p_private );
}
vlc_object_release( p_input );
}
if( !p_sys->p_meta )
p_sys->p_meta = vlc_meta_New();
......
......@@ -110,9 +110,17 @@ static int Open( vlc_object_t * p_this )
LOAD_PACKETIZER_OR_FAIL( p_sys->p_packetizer, "mp4 audio" );
/* Parse possible id3 header */
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
{
vlc_object_release( p_input );
return VLC_ENOMEM;
}
if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
{
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
......@@ -122,9 +130,13 @@ static int Open( vlc_object_t * p_this )
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 );
TAB_CLEAN( p_demux_meta->i_attachments,
p_demux_meta->attachments );
}
free( p_demux->p_private );
}
vlc_object_release( p_input );
}
return VLC_SUCCESS;
}
......
......@@ -255,9 +255,18 @@ static int Open( vlc_object_t * p_this )
p_sys->p_block_out = p_block_out;
/* Parse possible id3 header */
input_thread_t *p_input = (input_thread_t *)
vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
{
vlc_object_release( p_input );
return VLC_ENOMEM;
}
if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
{
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
......@@ -268,6 +277,9 @@ static int Open( vlc_object_t * p_this )
p_sys->attachments = p_demux_meta->attachments;
}
free( p_demux->p_private );
}
vlc_object_release( p_input );
}
/* */
p_sys->p_packetizer->fmt_out.b_packetized = VLC_TRUE;
......
......@@ -210,6 +210,8 @@ static int Open( vlc_object_t * p_this )
p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
......@@ -228,9 +230,10 @@ static int Open( vlc_object_t * p_this )
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 );
}
vlc_object_release( p_input );
}
/* Initialize the Ogg physical bitstream parser */
ogg_sync_init( &p_sys->oy );
......
......@@ -141,9 +141,18 @@ static int Open( vlc_object_t * p_this )
#if 0
/* Parse possible id3 header */
input_thread_t *p_input = (input_thread_t *)
vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
{
p_demux->p_private = malloc( sizeof( demux_meta_t ) );
if( !p_demux->p_private )
{
vlc_object_release( p_input );
return VLC_ENOMEM;
}
if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
{
demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
......@@ -153,10 +162,13 @@ static int Open( vlc_object_t * p_this )
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 );
TAB_CLEAN( p_demux_meta->i_attachments,
p_demux_meta->attachments );
}
free( p_demux->p_private );
}
vlc_object_release( p_input );
}
if( !p_sys->p_meta )
p_sys->p_meta = vlc_meta_New();
#endif
......
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