[FFmpeg-devel] [PATCH] vobsub in mov support

Baptiste Coudurier baptiste.coudurier
Wed Apr 1 18:32:13 CEST 2009


On 4/1/2009 2:43 AM, Reimar D?ffinger wrote:
> On Wed, Apr 01, 2009 at 12:54:10AM -0700, Baptiste Coudurier wrote:
>>> ------------------------------------------------------------------------
>>>
>>> Index: libavformat/mov.c
>>> ===================================================================
>>> --- libavformat/mov.c	(revision 18285)
>>> +++ libavformat/mov.c	(working copy)
>>> @@ -806,7 +806,8 @@
>>>                  if(id > 0)
>>>                      st->codec->codec_type = CODEC_TYPE_SUBTITLE;
>>>              }
>>> -        }
>>> +        } else if (st->codec->codec_type == CODEC_TYPE_SUBTITLE)
>>> +            id = codec_get_id(ff_codec_movsubtitle_tags, format);
>> I believe this hunk is not needed.
>>
>>>          dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
>>>                  (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
>>> @@ -997,6 +998,7 @@
>>>              // ttxt stsd contains display flags, justification, background
>>>              // color, fonts, and default styles, so fake an atom to read it
>>>              MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) };
>>> +            if (id != CODEC_ID_DVD_SUBTITLE) // this contains a proper esds atom
>>>              mov_read_glbl(c, pb, fake_atom);
>>>              st->codec->codec_id= id;
>>>              st->codec->width = sc->width;
>> This hunk should be sufficient
> 
> No, certainly not. 

Yes it is, modulo changing the test to if (format != AV_RL32("mp4s"))

> ff_codec_movsubtitle_tags is only consulted for
> CODEC_TYPE_DATA, never for CODEC_TYPE_SUBTITLE, and in addition it is
> also skipped explicitly for mp4s (without that it would be overridden
> from CODEC_TYPE_SUBTITLE to CODEC_TYPE_VIDEO).
> The whole code is either very carefully crafted and severely lacking
> documentation or a very big piece of nonsense.

Please spare me your comments when you don't know the code.

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list