codec: avcodec: use filtered/best effort pts

fixes playback/stuttering with wrong mux/monotonically
increasing pts on frames that must be reordered.

no change for regular pts.

(cherry picked from commit 0834d39352)
This commit is contained in:
Francois Cartegnie 2020-12-12 13:07:49 +01:00 committed by Jean-Baptiste Kempf
parent e63e7a0634
commit 8dc979d578
1 changed files with 4 additions and 0 deletions

View File

@ -1117,7 +1117,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
/* Compute the PTS */
#if LIBAVCODEC_VERSION_CHECK(57, 24, 0, 61, 100)
# if LIBAVCODEC_VERSION_MICRO >= 100
mtime_t i_pts = frame->best_effort_timestamp;
# else
mtime_t i_pts = frame->pts;
# endif
#else
mtime_t i_pts = frame->pkt_pts;
#endif