aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2013-10-20 13:10:36 +0200
committerMarton Balint <cus@passwd.hu>2013-10-26 12:23:54 +0200
commit44758b4d17f6bcdfca74d329ad2fcff3e930bdbd (patch)
treee6091542ab3e3ae39c551054c9a80e3d120c9cad /ffplay.c
parent04de0e04c5d0e9298dc020dbdd02b72f6b6d61b7 (diff)
downloadffmpeg-44758b4d17f6bcdfca74d329ad2fcff3e930bdbd.tar.gz
ffplay: add support for libswresample options
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index 54764c6bba..5d3d18946e 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1833,6 +1833,8 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
int64_t channel_layouts[2] = { 0, -1 };
int channels[2] = { 0, -1 };
AVFilterContext *filt_asrc = NULL, *filt_asink = NULL;
+ char aresample_swr_opts[512] = "";
+ AVDictionaryEntry *e = NULL;
char asrc_args[256];
int ret;
@@ -1840,6 +1842,12 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
if (!(is->agraph = avfilter_graph_alloc()))
return AVERROR(ENOMEM);
+ while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX)))
+ av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value);
+ if (strlen(aresample_swr_opts))
+ aresample_swr_opts[strlen(aresample_swr_opts)-1] = '\0';
+ av_opt_set(is->agraph, "aresample_swr_opts", aresample_swr_opts, 0);
+
ret = snprintf(asrc_args, sizeof(asrc_args),
"sample_rate=%d:sample_fmt=%s:channels=%d:time_base=%d/%d",
is->audio_filter_src.freq, av_get_sample_fmt_name(is->audio_filter_src.fmt),