summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-05-09 06:39:37 +0200
committerAnton Khirnov <anton@khirnov.net>2012-05-14 21:36:11 +0200
commit6eeb9a0433d793dbd86c43d3dea1a2f8015f1147 (patch)
treed76b6760e32c091c721b5bae3b46639545a0e807 /avconv.c
parent369cb092ecbbaff20bb0a2a1d60536c3bc04a8f0 (diff)
avconv: automatically insert asyncts when -async is used.
Deprecate -async.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 25958ea559..85ee6f7e25 100644
--- a/avconv.c
+++ b/avconv.c
@@ -703,6 +703,33 @@ static int configure_audio_filters(FilterGraph *fg, AVFilterContext **in_filter,
*out_filter = format;
}
+ if (audio_sync_method > 0) {
+ AVFilterContext *async;
+ char args[256];
+ int len = 0;
+
+ av_log(NULL, AV_LOG_WARNING, "-async has been deprecated. Used the "
+ "asyncts audio filter instead.\n");
+
+ if (audio_sync_method > 1)
+ len += snprintf(args + len, sizeof(args) - len, "compensate=1:"
+ "max_comp=%d:", audio_sync_method);
+ snprintf(args + len, sizeof(args) - len, "min_delta=%f",
+ audio_drift_threshold);
+
+ ret = avfilter_graph_create_filter(&async,
+ avfilter_get_by_name("asyncts"),
+ "async", args, NULL, fg->graph);
+ if (ret < 0)
+ return ret;
+
+ ret = avfilter_link(*in_filter, 0, async, 0);
+ if (ret < 0)
+ return ret;
+
+ *in_filter = async;
+ }
+
return 0;
}