Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0cea9f8 authored by Glenn Kasten's avatar Glenn Kasten Committed by Gerrit Code Review
Browse files

Merge "Prevent invalid frame durations"

parents c0048178 f7c18cf1
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -2486,6 +2486,12 @@ M4OSA_ERR M4MP4W_processAU( M4OSA_Context context, M4SYS_StreamID streamID,


#endif
#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;
        mMp4FileDataPtr->videoTrackPtr->currentPos += auPtr->size;


        /* Warning: time conversion cast 64to32! */
        /* Warning: time conversion cast 64to32! */