From f7c18cf13354ac33b14de0af31c687f5e7d3a207 Mon Sep 17 00:00:00 2001 From: Ola Andersson Date: Wed, 5 Dec 2012 13:07:58 +0100 Subject: Prevent invalid frame durations Prevent frame duration from being negative when exporting movie studio project Change-Id: I459fb243650c777c2b59d1094acc88c3a944bd81 --- libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libvideoeditor') diff --git a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c index 9ad94e0..cdfc441 100755 --- a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c +++ b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c @@ -2486,6 +2486,12 @@ M4OSA_ERR M4MP4W_processAU( M4OSA_Context context, M4SYS_StreamID streamID, #endif + if ((M4MP4W_Time32)auPtr->CTS < mMp4FileDataPtr->videoTrackPtr->CommonData.lastCTS) { + // Do not report as error, it will abort the entire filewrite. Just skip this frame. + M4OSA_TRACE1_0("Skip frame. Video frame has too old timestamp."); + return M4NO_ERROR; + } + mMp4FileDataPtr->videoTrackPtr->currentPos += auPtr->size; /* Warning: time conversion cast 64to32! */ -- cgit v1.1