X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Freal.c;h=f3eb09408b193ffc6d44981eab7b06d0e69ff5ce;hb=05492281965ed211badf7e1f4c2220be720d3356;hp=8dd214cb807297f08ef33286e38964829450aed3;hpb=4edae60cb92459ac7cb8aa27700eb9ab1cd54d9c;p=vlc diff --git a/modules/demux/real.c b/modules/demux/real.c index 8dd214cb80..f3eb09408b 100644 --- a/modules/demux/real.c +++ b/modules/demux/real.c @@ -64,15 +64,15 @@ static int Open ( vlc_object_t * ); static void Close ( vlc_object_t * ); -vlc_module_begin(); - set_description( N_("Real demuxer" ) ); - set_capability( "demux", 15 ); - set_category( CAT_INPUT ); - set_subcategory( SUBCAT_INPUT_DEMUX ); - set_callbacks( Open, Close ); - add_shortcut( "real" ); - add_shortcut( "rm" ); -vlc_module_end(); +vlc_module_begin () + set_description( N_("Real demuxer" ) ) + set_capability( "demux", 0 ) + set_category( CAT_INPUT ) + set_subcategory( SUBCAT_INPUT_DEMUX ) + set_callbacks( Open, Close ) + add_shortcut( "real" ) + add_shortcut( "rm" ) +vlc_module_end () /***************************************************************************** * Local prototypes @@ -794,7 +794,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) msg_Dbg(p_demux, "Seek in real rtsp stream!"); p_sys->i_pcr = (int64_t)1000 * ( p_sys->i_our_duration * f ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); p_sys->b_seek = 1; return stream_Seek( p_demux->s, p_sys->i_pcr ); @@ -819,8 +818,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) p_sys->i_pcr = 1000 * (int64_t) p_index->time_offset; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); - return stream_Seek( p_demux->s, i64 ); } case DEMUX_SET_TIME: @@ -840,7 +837,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) } p_sys->i_pcr = 1000 * (int64_t) p_index->time_offset; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); return stream_Seek( p_demux->s, i64 ); @@ -935,10 +931,7 @@ static void ReadRealIndex( demux_t *p_demux ) p_sys->p_index = (rm_index_t *)malloc( sizeof( rm_index_t ) * (i_index_count+1) ); if( p_sys->p_index == NULL ) - { - msg_Err( p_demux, "Memory allocation error" ); return; - } memset( p_sys->p_index, 0, sizeof(rm_index_t) * (i_index_count+1) ); @@ -1491,6 +1484,8 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num ) msg_Dbg( p_demux, " - extra data=%d", fmt.i_extra ); tk = malloc( sizeof( real_track_t ) ); + if( !tk ) + return VLC_ENOMEM; tk->i_id = i_num; tk->fmt = fmt; tk->i_frame = 0; @@ -1527,9 +1522,11 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num ) } /* Check if the calloc went correctly */ - if( tk->p_subpackets == NULL ) + if( !tk->p_subpackets && !tk->p_subpackets_timecode) { - tk->i_subpackets = 0; + free( tk->p_subpackets_timecode ); + free( tk->p_subpackets ); + free( tk ); msg_Err( p_demux, "Can't alloc subpacket" ); return VLC_EGENERIC; }