[FFmpeg-devel] [RFC] TS/DVB subtitle sub_id hack

Joakim Plate elupus
Tue Jul 13 13:05:35 CEST 2010


Baptiste Coudurier <baptiste.coudurier <at> gmail.com> writes:

> 
> On 07/12/2010 02:57 AM, Joakim Plate wrote:
> > Reimar D?ffinger<Reimar.Doeffinger<at>  gmx.de>  writes:
> >
> >>
> >>>> Or should then all have a special case for DVBSUB as well?
> >>>> I can't image misusing codec_tag as ending up as anything other
> >>>> than quite painful.
> >>>
> >>> Like sub_id it is simpler, malloc is way more painful.
> >
> > Please don't use codec_tag... Using extradata is seamless to most 
applications
> > that use lavf/lavc since they already pass that data along from demuxer
> > to codecs (well we already do anyway).
> >
> > We have a hack in for sub_id, but extradata makes much more sence imho.
> 
> What hack do you have ?
> 
> Can you please laborate what problem does codec_tag has ?
> 

Calling it a hack was probably a bit harsh. We don't pass along the whole 
avcodeccontext struct from the demuxer to the decoder. We grab the required 
setup data from the demuxer's avcodeccontext and pass that to the codec where we 
create a new avcodeccontext for use at decoding. (the race conditions michael 
talked about never apply to us). This is to be able to mix decoders for ffmpeg 
and other demuxers and the opposite.

To support dvb subtitles, we had to pass along the sub_id. Which isn't required 
for any other codec that i know of. The way it's used currently matches fully 
extradata imho.

codec_tag would be the same situations asfar as i know. I can't think of any 
decoder that require you to set this prior to starting decoding. So i see no 
benefit (only extra work for lavf/c users like us) to switching to codec_tag.

But this seems mute now that michael and reimar seem to have agreed to just 
ignore the "filter" totally. (must say i'd rather have seen them change to using 
extradata instead and allowed it to change midstream since that would have 
worked perfectly fine for us).


/Joakim




More information about the ffmpeg-devel mailing list