Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2016-09-04 17:49:44 +0300
committerBurt P <pburt0@gmail.com>2016-09-07 18:54:08 +0300
commite700e21b6ff5765e344201997f80f26fe7792ee9 (patch)
tree530b6e47e4b71b294e5afb1567072a641bd6b830 /libavfilter/af_hdcd.c
parent91be2ad756d658acc24fec5bc46c1775158d28b0 (diff)
af_hdcd: move decoding setup from init to config_input
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'libavfilter/af_hdcd.c')
-rw-r--r--libavfilter/af_hdcd.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c
index 6bc408cbe3..641076aa7f 100644
--- a/libavfilter/af_hdcd.c
+++ b/libavfilter/af_hdcd.c
@@ -1777,31 +1777,15 @@ static av_cold void uninit(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)
{
HDCDContext *s = ctx->priv;
- int c;
s->sample_count = 0;
s->fctx = ctx;
s->bad_config = 0;
- hdcd_detect_reset(&s->detect);
- for (c = 0; c < HDCD_MAX_CHANNELS; c++) {
- hdcd_reset(&s->state[c], 44100, s->cdt_ms);
- }
-
- av_log(ctx, AV_LOG_VERBOSE, "CDT period: %dms (%u samples @44100Hz)\n",
- s->cdt_ms, s->state[0].sustain_reset );
- av_log(ctx, AV_LOG_VERBOSE, "Process mode: %s\n",
- (s->process_stereo) ? "process stereo channels together" : "process each channel separately");
- av_log(ctx, AV_LOG_VERBOSE, "Force PE: %s\n",
- (s->force_pe) ? "on" : "off");
- av_log(ctx, AV_LOG_VERBOSE, "Analyze mode: [%d] %s\n",
- s->analyze_mode, ana_mode_str[s->analyze_mode] );
- if (s->disable_autoconvert)
+ if (s->disable_autoconvert) {
+ av_log(ctx, AV_LOG_VERBOSE, "Disabling automatic format conversion.\n");
avfilter_graph_set_auto_convert(ctx->graph, AVFILTER_AUTO_CONVERT_NONE);
- av_log(ctx, AV_LOG_VERBOSE, "Auto-convert: %s (requested: %s)\n",
- (ctx->graph->disable_auto_convert) ? "disabled" : "enabled",
- (s->disable_autoconvert) ? "disable" : "do not disable" );
-
+ }
return 0;
}
@@ -1809,11 +1793,29 @@ static int config_input(AVFilterLink *inlink) {
AVFilterContext *ctx = inlink->dst;
HDCDContext *s = ctx->priv;
AVFilterLink *lk;
+ int c;
+
+ av_log(ctx, AV_LOG_VERBOSE, "Auto-convert: %s\n",
+ (ctx->graph->disable_auto_convert) ? "disabled" : "enabled");
+
+ hdcd_detect_reset(&s->detect);
+ for (c = 0; c < HDCD_MAX_CHANNELS; c++) {
+ hdcd_reset(&s->state[c], inlink->sample_rate, s->cdt_ms);
+ }
+ av_log(ctx, AV_LOG_VERBOSE, "CDT period: %dms (%u samples @44100Hz)\n",
+ s->cdt_ms, s->state[0].sustain_reset );
if (inlink->channels != 2 && s->process_stereo) {
av_log(ctx, AV_LOG_WARNING, "process_stereo disabled (channels = %d)", inlink->channels);
s->process_stereo = 0;
}
+ av_log(ctx, AV_LOG_VERBOSE, "Process mode: %s\n",
+ (s->process_stereo) ? "process stereo channels together" : "process each channel separately");
+
+ av_log(ctx, AV_LOG_VERBOSE, "Force PE: %s\n",
+ (s->force_pe) ? "on" : "off");
+ av_log(ctx, AV_LOG_VERBOSE, "Analyze mode: [%d] %s\n",
+ s->analyze_mode, ana_mode_str[s->analyze_mode] );
lk = inlink;
while(lk != NULL) {