[FFmpeg-devel] [PATCH 1/4] lavc: correctly set AVSubtitle format for text based subtitles.

Wolfram Gloger wmglo at dent.med.uni-muenchen.de
Mon Dec 31 13:30:57 CET 2012


> On Wed, Nov 28, 2012 at 11:37:15AM +0100, Nicolas George wrote:
>> Le septidi 7 frimaire, an CCXXI, Clément Bœsch a écrit :
>> > ---
>> >  libavcodec/utils.c | 1 +
>> >  1 file changed, 1 insertion(+)
>> I do not think it can cause any problem, but this AVSubtitle structure is
>> very ugly. So probably ok.

Clément Bœsch <ubitux at gmail.com> writes:

> Finally applied, thanks.

         ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &tmp);
+        sub->format = sub->num_rects && sub->rects[0]->ass;

Firstly, the AVSubtitle 'format' field appears to be totally unused in
ffmpeg currently, right?

If the intent is to define "format == 1" for text subtitles
rather than 'graphics', please add a comment to avcodec.h to
that effect.

But I think this _will_ cause problems because

(a) I see nothing that forbids a decoder generating graphics and _text_
    rectangles in the same AVSubtitle.  Why should we forbid that?

(b) If anything, the codec->decode function should set sub->format;
    otherwise, how would a completely new decoder set text format?
    ASS markup may be good today but I still think it's not the least
    common denominator and also it may not be possible for all future
    text decoders.


More information about the ffmpeg-devel mailing list