[FFmpeg-cvslog] mxf: Handle negative edit_rate

Luca Barbato git at videolan.org
Sun Feb 2 05:14:33 CET 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Wed Jan  8 01:20:00 2014 +0100| [7d56f2fffc14ad02001ee0689bee76a759da9ede] | committer: Luca Barbato

mxf: Handle negative edit_rate

Default to 1/25.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d56f2fffc14ad02001ee0689bee76a759da9ede
---

 libavformat/mxfdec.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index cb383b0..31ac9a8 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1422,6 +1422,15 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
         if (st->duration == -1)
             st->duration = AV_NOPTS_VALUE;
         st->start_time = component->start_position;
+        if (material_track->edit_rate.num <= 0 ||
+            material_track->edit_rate.den <= 0) {
+            av_log(mxf->fc, AV_LOG_WARNING,
+                   "Invalid edit rate (%d/%d) found on stream #%d, "
+                   "defaulting to 25/1\n",
+                   material_track->edit_rate.num,
+                   material_track->edit_rate.den, st->index);
+            material_track->edit_rate = (AVRational){25, 1};
+        }
         avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
 
         PRINT_KEY(mxf->fc, "data definition   ul", source_track->sequence->data_definition_ul);



More information about the ffmpeg-cvslog mailing list