1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

ffmpeg: fix passing swresample options to the auto inserted swr

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-23 15:35:48 +01:00
parent 69d45d2ecb
commit 4bd6d73fc8

View File

@ -28,6 +28,7 @@
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/imgutils.h"
@ -724,6 +725,15 @@ int configure_filtergraph(FilterGraph *fg)
char args[255];
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
fg->graph->scale_sws_opts = av_strdup(args);
args[0] = 0;
if (ost->swr_dither_method)
av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
if (ost->swr_dither_scale != 1.0)
av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
if (strlen(args))
args[strlen(args)-1] = 0;
av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
}
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)