summaryrefslogtreecommitdiff
path: root/ffmpeg_filter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-08 13:33:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-08 14:44:15 +0200
commit6dbaeed6b7b7c858dffdf141b725506b887660e7 (patch)
tree4a1cd9d605da56b75e285258e92ae46d5994df85 /ffmpeg_filter.c
parentd3d776ccf94c988755efb264e318e97a11fea194 (diff)
downloadffmpeg-6dbaeed6b7b7c858dffdf141b725506b887660e7.tar.gz
ffmpeg: switch swscale option handling to AVDictionary similar to what the other subsystems use
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index ce2ffc0b7a..8a96c4be86 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -423,11 +423,17 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
if (codec->width || codec->height) {
char args[255];
AVFilterContext *filter;
+ AVDictionaryEntry *e = NULL;
- snprintf(args, sizeof(args), "%d:%d:0x%X",
+ snprintf(args, sizeof(args), "%d:%d",
codec->width,
- codec->height,
- (unsigned)ost->sws_flags);
+ codec->height);
+
+ while ((e = av_dict_get(ost->sws_dict, "", e,
+ AV_DICT_IGNORE_SUFFIX))) {
+ av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value);
+ }
+
snprintf(name, sizeof(name), "scaler for output stream %d:%d",
ost->file_index, ost->index);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
@@ -961,7 +967,13 @@ int configure_filtergraph(FilterGraph *fg)
char args[512];
AVDictionaryEntry *e = NULL;
- snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
+ args[0] = 0;
+ while ((e = av_dict_get(ost->sws_dict, "", e,
+ AV_DICT_IGNORE_SUFFIX))) {
+ av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
+ }
+ if (strlen(args))
+ args[strlen(args)-1] = 0;
fg->graph->scale_sws_opts = av_strdup(args);
args[0] = 0;