From patchwork Tue Sep 19 19:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 43802 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a886:b0:149:dfde:5c0a with SMTP id ca6csp170052pzb; Tue, 19 Sep 2023 12:23:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0IoQgTTfK9oPDcQLqp2mgxRS7Xi/jueqDqcermGs8NWUZ5tZPBbO2dt1w4Xb1f7yNf00Z X-Received: by 2002:a17:906:7493:b0:9ae:40d1:9969 with SMTP id e19-20020a170906749300b009ae40d19969mr870233ejl.32.1695151438527; Tue, 19 Sep 2023 12:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695151438; cv=none; d=google.com; s=arc-20160816; b=oGbWtTjEGhIP9+vABQJJ8ICmY9BUyj2htyrGvQLLivhlpGS3w8WE4Q0T4tHIQN8T29 g4dSP3UmtHorMCnhTqaYnr/QDXMUBMeuKLi6unVjHkgRIPl7LzfcPvim42xNbHQAkLud CkJiVDH7gB/AbHgqCnKz7cyUy1jXv91u/TQpKe3Zk+tVDBWGdOWZdqPjOw/UQ9UsNYdv 2y5rnyNvkwPR/Y5JEXtqPpOcs7CTleN3yd9MfAO6tsLLmpcEt4JHjNiyuoRswEZzREU3 eKzuxFmOEeFlPpUiob9Pu8nhY6IFermkjyuNNZFt9D2w6I5A40tqpvGkbc+YC0AJ/bMh +0Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Ti/hYZukQe23p1/TtMrlzsY0GxkwjVAInxQvzVDPiOQ=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=T34aqC3UzlBIS3ISPyJ6g6OyFO8b4NsZktaCXTijEcHMtES1Lu5a301izgN7+3lW/7 njlmZhqqAWcwNjQQslBTPO0r+8KMVdx315FS2oX/HcjG+x8ROIxSScrp+4rxT9JrCcM9 p3iTdrhtvcR/l0B9Yjczqw0tRYP+IxeJdesqVnzGFMJ3CYyxCEp3c+jOUo/G5C+MfBZN E0Qm1qU3Tlo6L9iC5WYT0ngiRtstb6OGYCbq3KNY4cAndj90zUNCmeTfibzgTdsfNuX4 SlEClPkPFDGotZMMq1UVeiz7TyJw67K0iTKiDYqdLY/iN0ynD/IzsHpTY23hW5GEpTtH PCpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d14-20020a1709067f0e00b00993a68a3afcsi11511342ejr.489.2023.09.19.12.23.57; Tue, 19 Sep 2023 12:23:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6ABF568C99E; Tue, 19 Sep 2023 22:21:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D64368C8ED for ; Tue, 19 Sep 2023 22:21:34 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id A1BC95103 for ; Tue, 19 Sep 2023 21:21:34 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 8gDO4qtZS6cK for ; Tue, 19 Sep 2023 21:21:29 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id EC9F2517F for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id E0EDC3A0212 for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Sep 2023 21:10:46 +0200 Message-Id: <20230919191044.18873-20-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919191044.18873-1-anton@khirnov.net> References: <20230919191044.18873-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 19/27] XXX ffmpeg temporarily disable -stream_loop X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ep7jwrSenMtx It conflicts with threading work. --- fftools/ffmpeg.h | 6 +++--- fftools/ffmpeg_dec.c | 4 ++++ fftools/ffmpeg_demux.c | 8 +++++++- tests/fate/ffmpeg.mak | 12 ++++++------ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 88b8ed12c0..a4fd825749 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -45,7 +45,7 @@ #include "libavutil/pixfmt.h" #include "libavutil/rational.h" #include "libavutil/thread.h" -#include "libavutil/threadmessage.h" +//#include "libavutil/threadmessage.h" #include "libswresample/swresample.h" @@ -438,8 +438,8 @@ typedef struct InputFile { /* when looping the input file, this queue is used by decoders to report * the last frame duration back to the demuxer thread */ - AVThreadMessageQueue *audio_duration_queue; - int audio_duration_queue_size; + //AVThreadMessageQueue *audio_duration_queue; + //int audio_duration_queue_size; } InputFile; enum forced_keyframes_const { diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index fb7b404020..36163195ca 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -702,6 +702,7 @@ static void *decoder_thread(void *arg) if (!flush_buffers) break; +#if 0 /* report last frame duration to the demuxer thread */ if (ist->dec->type == AVMEDIA_TYPE_AUDIO) { LastFrameDuration dur; @@ -713,6 +714,7 @@ static void *decoder_thread(void *arg) av_thread_message_queue_send(ifile->audio_duration_queue, &dur, 0); } +#endif avcodec_flush_buffers(ist->dec_ctx); } else if (ret < 0) { @@ -738,10 +740,12 @@ finish: tq_receive_finish(d->queue_in, 0); tq_send_finish (d->queue_out, 0); +#if 0 // make sure the demuxer does not get stuck waiting for audio durations // that will never arrive if (ifile->audio_duration_queue && ist->dec->type == AVMEDIA_TYPE_AUDIO) av_thread_message_queue_set_err_recv(ifile->audio_duration_queue, AVERROR_EOF); +#endif dec_thread_uninit(&dt); diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 0955956117..ea74b45663 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -150,6 +150,7 @@ static void report_new_stream(Demuxer *d, const AVPacket *pkt) d->nb_streams_warn = pkt->stream_index + 1; } +#if 0 static void ifile_duration_update(Demuxer *d, DemuxStream *ds, int64_t last_duration) { @@ -217,6 +218,7 @@ static int seek_to_start(Demuxer *d) return ret; } +#endif static void ts_discontinuity_detect(Demuxer *d, InputStream *ist, AVPacket *pkt) @@ -568,6 +570,7 @@ static void *input_thread(void *arg) continue; } if (ret < 0) { +#if 0 if (d->loop) { /* signal looping to the consumer thread */ pkt->opaque = (void*)(intptr_t)PKT_OPAQUE_SEEK; @@ -579,6 +582,7 @@ static void *input_thread(void *arg) /* fallthrough to the error path */ } +#endif if (ret == AVERROR_EOF) av_log(d, AV_LOG_VERBOSE, "EOF while reading input\n"); @@ -655,7 +659,7 @@ static void thread_stop(Demuxer *d) tq_free(&d->thread_queue); - av_thread_message_queue_free(&f->audio_duration_queue); + //av_thread_message_queue_free(&f->audio_duration_queue); } static int thread_start(Demuxer *d) @@ -677,6 +681,7 @@ static int thread_start(Demuxer *d) return AVERROR(ENOMEM); } +#if 0 if (d->loop) { int nb_audio_dec = 0; @@ -694,6 +699,7 @@ static int thread_start(Demuxer *d) f->audio_duration_queue_size = nb_audio_dec; } } +#endif if ((ret = pthread_create(&d->thread, NULL, input_thread, d))) { av_log(d, AV_LOG_ERROR, "pthread_create failed: %s. Try to increase `ulimit -v` or decrease `ulimit -s`.\n", strerror(ret)); diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index ebc1e1f189..a5dac5476a 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -154,10 +154,10 @@ fate-ffmpeg-fix_sub_duration: CMD = fmtstdout srt -fix_sub_duration \ # FIXME: the integer AAC decoder does not produce the same output on all platforms # so until that is fixed we use the volume filter to silence the data -FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MATROSKA, H264 AAC_FIXED, PCM_S32LE_ENCODER VOLUME_FILTER) += fate-ffmpeg-streamloop-transcode-av -fate-ffmpeg-streamloop-transcode-av: CMD = \ - framecrc -auto_conversion_filters -stream_loop 3 -c:a aac_fixed -i $(TARGET_SAMPLES)/mkv/1242-small.mkv \ - -af volume=0:precision=fixed -c:a pcm_s32le +#FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MATROSKA, H264 AAC_FIXED, PCM_S32LE_ENCODER VOLUME_FILTER) += fate-ffmpeg-streamloop-transcode-av +#fate-ffmpeg-streamloop-transcode-av: CMD = \ +# framecrc -auto_conversion_filters -stream_loop 3 -c:a aac_fixed -i $(TARGET_SAMPLES)/mkv/1242-small.mkv \ +# -af volume=0:precision=fixed -c:a pcm_s32le FATE_STREAMCOPY-$(call REMUX, MP4 MOV, EAC3_DEMUXER) += fate-copy-trac3074 fate-copy-trac3074: CMD = transcode eac3 $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3\ @@ -194,8 +194,8 @@ FATE_STREAMCOPY-$(call REMUX, PSP MOV, H264_PARSER H264_DECODER) += fate-copy-ps fate-copy-psp: CMD = transcode "mov" $(TARGET_SAMPLES)/h264/wwwq_cut.mp4\ psp "-c copy" "-codec copy" -FATE_STREAMCOPY-$(call FRAMEMD5, FLV, H264) += fate-ffmpeg-streamloop-copy -fate-ffmpeg-streamloop-copy: CMD = framemd5 -stream_loop 2 -i $(TARGET_SAMPLES)/flv/streamloop.flv -c copy +#FATE_STREAMCOPY-$(call FRAMEMD5, FLV, H264) += fate-ffmpeg-streamloop-copy +#fate-ffmpeg-streamloop-copy: CMD = framemd5 -stream_loop 2 -i $(TARGET_SAMPLES)/flv/streamloop.flv -c copy tests/data/audio_shorter_than_video.nut: TAG = GEN tests/data/audio_shorter_than_video.nut: tests/data/vsynth_lena.yuv