[FFmpeg-devel] [RFC] TS/DVB subtitle sub_id hack
Baptiste Coudurier
baptiste.coudurier
Tue Jul 13 22:32:57 CEST 2010
On 07/12/2010 01:30 PM, Michael Niedermayer wrote:
> On Mon, Jul 12, 2010 at 08:12:16PM +0200, Reimar D?ffinger wrote:
>> On Mon, Jul 12, 2010 at 04:34:26PM +0200, Michael Niedermayer wrote:
>>> On Sun, Jul 11, 2010 at 11:11:31PM -0700, Baptiste Coudurier wrote:
>>>> On 7/11/10 3:43 PM, Reimar D?ffinger wrote:
>>>>> On Sun, Jul 11, 2010 at 03:33:00PM -0700, Baptiste Coudurier wrote:
>>>>>> Even easier is to use codec_tag.
>>>>>>
>>>>>> I don't think extradata is a good idea. It makes applications do if
>>>>>> codec_id == CODEC_ID_DVBSUB then set extradata which is more
>>>>>> complicated than setting sub_id even if it does not conform to the
>>>>>> documentation.
>>>>>
>>>>> How is if (codec_id == CODEC_ID_DVBSUB) {misuse codec_tag}
>>>>> significantly better?
>>>>
>>>> At least, it avoids malloc.
>>>> Besides the anc value change it will be more complicated to handle,
>>>> since extradata is not supposed to change.
>>>
>>> if the anc value changes (i dont know if thats allowed btw) then all
>>> variants discussed will have a race condition.
>>
>> Well, if we want that to work, the MPEG-TS demuxer would probably have
>> to throw away all subpackets that do not match the IDs.
>> Considering that the whole sub_id selection thing is broken anyway (e.g.
>> if there's really a file with multiple sub ids not only could we decode
>> only one, we might even randomly switch between them depending on in which
>> order they are in the PMT), I intend to just remove the check from the
>> dvbsub decoder, I can't see it doing anything but harm.
>
> yes
>
> lets hope such files dont exist in the wild, or we will have to find a
> way to support them. Which would mean either demux subtitle streams further
> in the mpegts demuxer or a subtitle stream demuxer chained after mpegts
> or duplicate streams in the mpegts demuxer + extradata + that check in the
> decoder
> none of these is pretty& easy
>
Well, it seems that even if I don't link the malloc and extradata
approach, people that expressed their opinion prefer it, and this needs
to be fixed, so let's use that method.
Reimar, you can apply your second patch.
--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel
mailing list