diff mbox series

[FFmpeg-devel,08/31] fftools/ffmpeg_dec: drop useless and racy code

Message ID 20240124081702.4759-8-anton@khirnov.net
State Accepted
Commit 27de2aacd15c78015327cfcc7e890b25d5295b02
Headers show
Series [FFmpeg-devel,01/31] fftools/ffmpeg_dec: split Decoder into a private and public part | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Jan. 24, 2024, 8:16 a.m. UTC
Setting demuxer's video_delay from the decoder cannot accomplish
anything meaningful and is racy, as they run in different threads.
---
 fftools/ffmpeg_dec.c | 15 ---------------
 1 file changed, 15 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c
index 4a59a4b392..baaba966c6 100644
--- a/fftools/ffmpeg_dec.c
+++ b/fftools/ffmpeg_dec.c
@@ -263,21 +263,6 @@  static int video_frame_process(InputStream *ist, AVFrame *frame)
 {
     DecoderPriv *dp = dp_from_dec(ist->decoder);
 
-    // The following line may be required in some cases where there is no parser
-    // or the parser does not has_b_frames correctly
-    if (ist->par->video_delay < dp->dec_ctx->has_b_frames) {
-        if (dp->dec_ctx->codec_id == AV_CODEC_ID_H264) {
-            ist->par->video_delay = dp->dec_ctx->has_b_frames;
-        } else
-            av_log(dp->dec_ctx, AV_LOG_WARNING,
-                   "video_delay is larger in decoder than demuxer %d > %d.\n"
-                   "If you want to help, upload a sample "
-                   "of this file to https://streams.videolan.org/upload/ "
-                   "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\n",
-                   dp->dec_ctx->has_b_frames,
-                   ist->par->video_delay);
-    }
-
     if (dp->dec_ctx->width  != frame->width ||
         dp->dec_ctx->height != frame->height ||
         dp->dec_ctx->pix_fmt != frame->format) {