From f9cefbfec4d7bfec44991d4372aad4fc1b3167a5 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 21 Dec 2015 17:35:15 -0800 Subject: vd_lavc: feed A53_CC side data packets into the demuxer for eia_608 decoding --- video/decode/vd_lavc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index f47e72a1cd..9677e4c079 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -41,6 +41,7 @@ #include "video/img_format.h" #include "video/filter/vf.h" #include "video/decode/dec_video.h" +#include "demux/demux.h" #include "demux/stheader.h" #include "demux/packet.h" #include "video/csputils.h" @@ -680,6 +681,16 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL); vd->codec_dts = mp_pts_from_av(ctx->pic->pkt_dts, NULL); + AVFrameSideData *sd = NULL; + sd = av_frame_get_side_data(ctx->pic, AV_FRAME_DATA_A53_CC); + if (sd) { + struct demux_packet *cc = new_demux_packet_from(sd->data, sd->size); + cc->pts = vd->codec_pts; + cc->dts = vd->codec_dts; + cc->pos = -1; + demuxer_feed_caption(vd->header, cc); + } + struct mp_image *mpi = mp_image_from_av_frame(ctx->pic); av_frame_unref(ctx->pic); if (!mpi) -- cgit v1.2.3