[FFmpeg-cvslog] fftools/ffmpeg: eliminate InputStream.got_output
Anton Khirnov
git at videolan.org
Mon May 22 18:12:00 EEST 2023
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue May 16 19:19:09 2023 +0200| [4a59dde0c72b97515582beab4ee182be09360005] | committer: Anton Khirnov
fftools/ffmpeg: eliminate InputStream.got_output
It tracks whether the decoder for this stream ever produced any frames
and its only use is for checking whether a filter input ever received a
frame - those that did not are prioritized by the scheduler.
This is awkward and unnecessarily complicated - checking whether the
filtergraph input format is valid works just as well and does not
require maintaining an extra variable.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a59dde0c72b97515582beab4ee182be09360005
---
fftools/ffmpeg.c | 3 ---
fftools/ffmpeg.h | 2 --
fftools/ffmpeg_filter.c | 2 +-
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 49313edebc..62620bacce 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1412,9 +1412,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
break;
}
- if (got_output)
- ist->got_output = 1;
-
if (!got_output)
break;
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 04c41a5311..3a332768df 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -413,8 +413,6 @@ typedef struct InputStream {
// number of frames/samples retrieved from the decoder
uint64_t frames_decoded;
uint64_t samples_decoded;
-
- int got_output;
} InputStream;
typedef struct LastFrameDuration {
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6f842f6b46..640ecec067 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1700,7 +1700,7 @@ int fg_transcode_step(FilterGraph *graph, InputStream **best_ist)
for (int i = 0; i < graph->nb_inputs; i++) {
InputFilter *ifilter = graph->inputs[i];
InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
- if (!ifp->ist->got_output && !ifp->eof) {
+ if (ifp->format < 0 && !ifp->eof) {
*best_ist = ifp->ist;
return 0;
}
More information about the ffmpeg-cvslog
mailing list