From 52e33126e5d33bd3adf6fce027965396e84c6506 Mon Sep 17 00:00:00 2001 From: Asd-g <65298684+Asd-g@users.noreply.github.com> Date: Tue, 31 Dec 2024 03:55:56 +0200 Subject: [PATCH] Revert the dts seeking logic for VC-1 (8d6bf98) --- common/lwlibav_video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/lwlibav_video.c b/common/lwlibav_video.c index c036539c..5618381d 100644 --- a/common/lwlibav_video.c +++ b/common/lwlibav_video.c @@ -449,8 +449,9 @@ static uint32_t correct_current_frame_number // earlier frame. // Therefore, we should not just give up when dts == AV_NOPTS_VALUE, and we have to also check some // others fields, especially when lw_seek_flags is more than just SEEK_DTS_BASED. - if( (pkt->dts == AV_NOPTS_VALUE && ((vdhp->lw_seek_flags & ~SEEK_DTS_BASED) == 0)) - || MATCH_DTS( p ) || MATCH_POS( p ) ) + int undef_timestamp = (vdhp->ctx->codec_id == AV_CODEC_ID_VC1) ? pkt->dts == AV_NOPTS_VALUE : + (pkt->dts == AV_NOPTS_VALUE && ((vdhp->lw_seek_flags & ~SEEK_DTS_BASED) == 0)); + if( undef_timestamp || MATCH_DTS( p ) || MATCH_POS( p ) ) return i; if( pkt->dts > info[p].dts ) {