Skip to content

Commit

Permalink
ffmpeg7 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
substring committed May 4, 2024
1 parent 67ca08c commit 670c22b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,16 +778,16 @@ void FeVideoImp::video_thread()
if ( raw_frame->pts == AV_NOPTS_VALUE )
raw_frame->pts = packet->dts;


#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 30, 100 ))
// AVFrame.pkt_duration renamed to AVFrame.duration with FFmpeg 6
#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 58, 2, 100 ))
// Correct for out of bounds pts
if ( raw_frame->pts < prev_pts )
raw_frame->pts = prev_pts + prev_duration;

// Track pts and duration if we need to correct next frame
prev_pts = raw_frame->pts;
prev_duration = raw_frame->duration;
#elif (LIBAVUTIL_VERSION_MICRO >= 100 )
#elif (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 58, 2, 100 ))
// This only works on FFmpeg, exclude libav (it doesn't have pkt_duration
// Correct for out of bounds pts
if ( raw_frame->pts < prev_pts )
Expand Down

0 comments on commit 670c22b

Please sign in to comment.