aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-03-29 11:48:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-03 10:11:27 +0200
commit24e90d0c05194ed92c35babf674cb219f5e1377a (patch)
tree92c4043052b7e763b7023019a053c8e015611344
parentb61e596a147b7e9235048d93c0ea42c19bb8b7ba (diff)
downloadffmpeg-24e90d0c05194ed92c35babf674cb219f5e1377a.tar.gz
mxfenc: Don't allow muxing audio-only since it's not supported
This fixes muxing audio-only output resulting in SIGFPE due to lack of EditRate. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mxfenc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 810c5663be..b2ef1f3dbd 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1412,12 +1412,13 @@ static int mxf_write_header(AVFormatContext *s)
return AVERROR(ENOMEM);
st->priv_data = sc;
+ if ((i == 0) ^ (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)) {
+ av_log(s, AV_LOG_ERROR, "there must be exactly one video stream and it must be the first one\n");
+ return -1;
+ }
+
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
AVRational rate;
- if (i != 0) {
- av_log(s, AV_LOG_ERROR, "video stream must be first track\n");
- return -1;
- }
if (fabs(av_q2d(st->codec->time_base) - 1/25.0) < 0.0001) {
samples_per_frame = PAL_samples_per_frame;
mxf->time_base = (AVRational){ 1, 25 };