diff options
author | Aman Gupta <aman@tmm1.net> | 2015-12-21 17:35:15 -0800 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2016-01-18 12:14:52 -0800 |
commit | f9cefbfec4d7bfec44991d4372aad4fc1b3167a5 (patch) | |
tree | 1b74ac9e3d9dc978906636c7b2335b0cd3151570 /video/decode | |
parent | ed3e5330ec1f201895c90f73a0c099a75241b404 (diff) | |
download | mpv-f9cefbfec4d7bfec44991d4372aad4fc1b3167a5.tar.bz2 mpv-f9cefbfec4d7bfec44991d4372aad4fc1b3167a5.tar.xz |
vd_lavc: feed A53_CC side data packets into the demuxer for eia_608 decoding
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 11 |
1 files changed, 11 insertions, 0 deletions
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) |