lavfi/f_ebur128: remove request_frame hack.

pull/13/merge
Nicolas George 12 years ago
parent 77fa554b6e
commit 9566ba91ab
  1. 23
      libavfilter/f_ebur128.c

@ -128,7 +128,6 @@ typedef struct {
/* misc */
int loglevel; ///< log level for frame logging
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;
#define OFFSET(x) offsetof(EBUR128Context, x)
@ -317,6 +316,8 @@ static int config_video_output(AVFilterLink *outlink)
DRAW_RECT(ebur128->graph);
DRAW_RECT(ebur128->gauge);
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
@ -380,6 +381,8 @@ static int config_audio_output(AVFilterLink *outlink)
return AVERROR(ENOMEM);
}
outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
@ -400,21 +403,6 @@ static struct hist_entry *get_histogram(void)
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)
{
int ret;
@ -463,8 +451,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_audio_output,
};
if (ebur128->metadata)
pad.request_frame = audio_request_frame;
if (!pad.name)
return AVERROR(ENOMEM);
ff_insert_outpad(ctx, ebur128->do_video, &pad);
@ -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);
}

Loading…
Cancel
Save