summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-29 02:13:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-29 21:16:32 +0200
commit429f3266c14ac4851da007fcb3461f9acc99cbad (patch)
treedc885073a06f3160b59a0622052d57da869b96c7 /libavformat/mxfenc.c
parent7302d5e325977d4a8ff61422fdabdae0dc504ec0 (diff)
avformat/mxfenc: Check that the video codec in D-10 is MPEG-2
Others do not work, but nothing rejects them prior to this patch if the parameters otherwise match Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 12fc9abbc6..a07da69b11 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2101,6 +2101,10 @@ static int mxf_write_header(AVFormatContext *s)
sc->video_bit_rate = st->codecpar->bit_rate;
if (s->oformat == &ff_mxf_d10_muxer) {
+ if (st->codecpar->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
+ av_log(s, AV_LOG_ERROR, "error MXF D-10 only support MPEG-2 Video\n");
+ return AVERROR(EINVAL);
+ }
if ((sc->video_bit_rate == 50000000) && (mxf->time_base.den == 25)) {
sc->index = 3;
} else if ((sc->video_bit_rate == 49999840 || sc->video_bit_rate == 50000000) && (mxf->time_base.den != 25)) {