[FFmpeg-devel] [PATCH]lavc/mpeg12dec: Read Closed Captions from second field

Devin Heitmueller dheitmueller at kernellabs.com
Thu Nov 29 19:59:14 EET 2018


On Thu, Nov 29, 2018 at 12:55 PM Michael Niedermayer
<michael at niedermayer.cc> wrote:

> > +        if (s1->a53_caption) {
> > +            AVFrameSideData *sd;
> > +            av_frame_remove_side_data(s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC);
> > +            sd = av_frame_new_side_data(
> > +                s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
> > +                s1->a53_caption_size);
> > +            if (sd)
> > +                memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
> > +            av_freep(&s1->a53_caption);
> > +        }
>
> This is probably ok if only one field has data Attached to it, but if both
> have then both should be exported. Also the user should have some way to
> find out which of 2 fields data came from

Yeah, this will cause the captions from the first field to get lost.
It probably makes sense to look at the H.264 decoder, where this is
done properly (i.e. creating a side data that contains the captions
from both fields).

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com


More information about the ffmpeg-devel mailing list