summaryrefslogtreecommitdiff
path: root/avconv_filter.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-02 16:08:20 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-12-05 11:23:37 -0500
commit9a71d362a6b77ec215045e5a9d6bdfc427e37ce4 (patch)
treed5f7aaa3856f071b51f7cb2fefcb00881d6c69e5 /avconv_filter.c
parentb30a363331ac79331c1d002992689b5ff35bf813 (diff)
avconv: deprecate the -vol option
Remove the code for volume scaling in avconv.c and instead auto-insert a volume filter into the beginning of the filter chain.
Diffstat (limited to 'avconv_filter.c')
-rw-r--r--avconv_filter.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/avconv_filter.c b/avconv_filter.c
index 8f430b0be4..e9412abc96 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -452,6 +452,29 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
first_filter = async;
pad_idx = 0;
}
+ if (audio_volume != 256) {
+ AVFilterContext *volume;
+
+ av_log(NULL, AV_LOG_WARNING, "-vol has been deprecated. Use the volume "
+ "audio filter instead.\n");
+
+ snprintf(args, sizeof(args), "volume=%f", audio_volume / 256.0);
+
+ snprintf(name, sizeof(name), "graph %d volume for input stream %d:%d",
+ fg->index, ist->file_index, ist->st->index);
+ ret = avfilter_graph_create_filter(&volume,
+ avfilter_get_by_name("volume"),
+ name, args, NULL, fg->graph);
+ if (ret < 0)
+ return ret;
+
+ ret = avfilter_link(volume, 0, first_filter, pad_idx);
+ if (ret < 0)
+ return ret;
+
+ first_filter = volume;
+ pad_idx = 0;
+ }
if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
return ret;