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

Baptiste Coudurier baptiste.coudurier
Tue Jul 13 18:47:22 CEST 2010

On 07/13/2010 04:05 AM, Joakim Plate wrote:
> 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.

Like I said, check for codec_tag in mpeg4*, codec_tag is needed to 
enable workarounds and specialties of certain mpeg4 variants, so in 
order to leverage libavcodec correctly you should pass codec_tag along.


Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list