From b0017579b6e8de3d0d13dcfe0a4dd848dc6baa37 Mon Sep 17 00:00:00 2001 From: Kieran Kunhya Date: Wed, 8 Jul 2015 23:17:44 +0100 Subject: h264: Add support for Closed Caption export Signed-off-by: Vittorio Giovara --- libavcodec/h264.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavcodec/h264.c') diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 6925a8ac31..a225f5b5e2 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -832,6 +832,18 @@ static void decode_postinit(H264Context *h, int setup_finished) h->sei_reguserdata_afd_present = 0; } + if (h->a53_caption) { + AVFrameSideData *sd = av_frame_new_side_data(cur->f, + AV_FRAME_DATA_A53_CC, + h->a53_caption_size); + if (!sd) + return; + + memcpy(sd->data, h->a53_caption, h->a53_caption_size); + av_freep(&h->a53_caption); + h->a53_caption_size = 0; + } + // FIXME do something with unavailable reference frames /* Sort B-frames into display order */ -- cgit v1.2.3