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.
This commit is contained in:
Anton Khirnov 2023-05-16 19:19:09 +02:00
parent 5fa00b38e6
commit 4a59dde0c7
3 changed files with 1 additions and 6 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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;
}