diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-12 22:17:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-03 18:34:37 +0200 |
commit | ef973bd98d8ee35dbbdd622b075c50d11c0d67fd (patch) | |
tree | 8423a222ff793407c53af878a374ac1a20a798aa | |
parent | a56ec48d426f98702e7c6f76bdb5f036df56de4b (diff) | |
download | ffmpeg-ef973bd98d8ee35dbbdd622b075c50d11c0d67fd.tar.gz |
avformat/mxfenc: Fix labels for IEC PAL DV 420
-rw-r--r-- | libavformat/mxfenc.c | 9 | ||||
-rw-r--r-- | tests/ref/lavf/mxf_dv25 | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 3da96bf919..035e65ed43 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -48,6 +48,7 @@ #include "libavutil/time_internal.h" #include "libavcodec/bytestream.h" #include "libavcodec/dnxhddata.h" +#include "libavcodec/dv_profile.h" #include "libavcodec/h264.h" #include "libavcodec/internal.h" #include "audiointerleave.h" @@ -1812,6 +1813,7 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt) MXFStreamContext *sc = st->priv_data; uint8_t *vs_pack, *vsc_pack; int i, ul_index, frame_size, stype, pal; + const AVDVProfile *profile; if (mxf->header_written) return 1; @@ -1820,6 +1822,8 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt) if (pkt->size < 120000) return -1; + profile = av_dv_frame_profile(NULL, pkt->data, pkt->size); + vs_pack = pkt->data + 80*5 + 48; vsc_pack = pkt->data + 80*5 + 53; stype = vs_pack[3] & 0x1f; @@ -1854,6 +1858,11 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt) frame_size = pal ? 288000 : 240000; break; default: // DV25 + if (profile && profile->pix_fmt == AV_PIX_FMT_YUV420P && pal) { + ul_index = INDEX_DV25_525_60_IEC + pal; + frame_size = pal ? 144000 : 120000; + break; + } ul_index = INDEX_DV25_525_60 + pal; frame_size = pal ? 144000 : 120000; } diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25 index adecc07e70..85094828d1 100644 --- a/tests/ref/lavf/mxf_dv25 +++ b/tests/ref/lavf/mxf_dv25 @@ -1,3 +1,3 @@ -de98603ecc27c2f3cefd192d4820d3f4 *./tests/data/lavf/lavf.mxf_dv25 +1871bd11947924116776201f24fd0adf *./tests/data/lavf/lavf.mxf_dv25 3833389 ./tests/data/lavf/lavf.mxf_dv25 ./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52 |