Commit 9566ba91 authored by Nicolas George's avatar Nicolas George

lavfi/f_ebur128: remove request_frame hack.

parent 77fa554b
...@@ -128,7 +128,6 @@ typedef struct { ...@@ -128,7 +128,6 @@ typedef struct {
/* misc */ /* misc */
int loglevel; ///< log level for frame logging int loglevel; ///< log level for frame logging
int metadata; ///< whether or not to inject loudness results in frames int metadata; ///< whether or not to inject loudness results in frames
int request_fulfilled; ///< 1 if some audio just got pushed, 0 otherwise. FIXME: remove me
} EBUR128Context; } EBUR128Context;
#define OFFSET(x) offsetof(EBUR128Context, x) #define OFFSET(x) offsetof(EBUR128Context, x)
...@@ -317,6 +316,8 @@ static int config_video_output(AVFilterLink *outlink) ...@@ -317,6 +316,8 @@ static int config_video_output(AVFilterLink *outlink)
DRAW_RECT(ebur128->graph); DRAW_RECT(ebur128->graph);
DRAW_RECT(ebur128->gauge); DRAW_RECT(ebur128->gauge);
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0; return 0;
} }
...@@ -380,6 +381,8 @@ static int config_audio_output(AVFilterLink *outlink) ...@@ -380,6 +381,8 @@ static int config_audio_output(AVFilterLink *outlink)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0; return 0;
} }
...@@ -400,21 +403,6 @@ static struct hist_entry *get_histogram(void) ...@@ -400,21 +403,6 @@ static struct hist_entry *get_histogram(void)
return h; return h;
} }
/* This is currently necessary for the min/max samples to work properly.
* FIXME: remove me when possible */
static int audio_request_frame(AVFilterLink *outlink)
{
int ret;
AVFilterContext *ctx = outlink->src;
EBUR128Context *ebur128 = ctx->priv;
ebur128->request_fulfilled = 0;
do {
ret = ff_request_frame(ctx->inputs[0]);
} while (!ebur128->request_fulfilled && ret >= 0);
return ret;
}
static av_cold int init(AVFilterContext *ctx, const char *args) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
int ret; int ret;
...@@ -463,8 +451,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args) ...@@ -463,8 +451,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.config_props = config_audio_output, .config_props = config_audio_output,
}; };
if (ebur128->metadata)
pad.request_frame = audio_request_frame;
if (!pad.name) if (!pad.name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ff_insert_outpad(ctx, ebur128->do_video, &pad); ff_insert_outpad(ctx, ebur128->do_video, &pad);
...@@ -717,7 +703,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) ...@@ -717,7 +703,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
} }
} }
ebur128->request_fulfilled = 1;
return ff_filter_frame(ctx->outputs[ebur128->do_video], insamples); return ff_filter_frame(ctx->outputs[ebur128->do_video], insamples);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment