[FFmpeg-devel] [PATCH 1/2] lavf/mxfenc: better error handling with invalid frame rate.

Clément Bœsch ubitux at gmail.com
Fri Aug 3 10:25:21 CEST 2012


From: Clément Bœsch <clement.boesch at smartjog.com>

---
 libavformat/mxfenc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 987f270..1e72106 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1703,8 +1703,9 @@ static int mxf_write_header(AVFormatContext *s)
                 mxf->time_base = (AVRational){ 1001, 60000 };
                 mxf->timecode_base = 60;
             } else {
-                av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n");
-                return -1;
+                av_log(s, AV_LOG_ERROR, "Unsupported video frame rate %d/%d\n",
+                       st->codec->time_base.den, st->codec->time_base.num);
+                return AVERROR(EINVAL);
             }
             rate = (AVRational){mxf->time_base.den, mxf->time_base.num};
             avpriv_set_pts_info(st, 64, mxf->time_base.num, mxf->time_base.den);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list