Commit 24e90d0c authored by Tomas Härdin's avatar Tomas Härdin Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b61e596a
...@@ -1412,12 +1412,13 @@ static int mxf_write_header(AVFormatContext *s) ...@@ -1412,12 +1412,13 @@ static int mxf_write_header(AVFormatContext *s)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->priv_data = sc; 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) { if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
AVRational rate; 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) { if (fabs(av_q2d(st->codec->time_base) - 1/25.0) < 0.0001) {
samples_per_frame = PAL_samples_per_frame; samples_per_frame = PAL_samples_per_frame;
mxf->time_base = (AVRational){ 1, 25 }; mxf->time_base = (AVRational){ 1, 25 };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment