diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-08 12:44:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-08 13:25:12 +0200 |
commit | e755954a84c96d7344e12ce6e798660d8bf261ea (patch) | |
tree | 411d3deaf89348d21105288c0449c9adf56fcc2f /ffplay.c | |
parent | 165fb7eba80c3829fbdadd2f5da47f081294613b (diff) | |
download | ffmpeg-e755954a84c96d7344e12ce6e798660d8bf261ea.tar.gz |
ffplay: pass all sws options to the filter graph
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1787,15 +1787,23 @@ fail: static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; - char sws_flags_str[128]; + char sws_flags_str[512] = ""; char buffersrc_args[256]; int ret; AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; AVCodecContext *codec = is->video_st->codec; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); + AVDictionaryEntry *e = NULL; + + while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) { + if (!strcmp(e->key, "sws_flags")) { + av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value); + } else + av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", e->key, e->value); + } + if (strlen(sws_flags_str)) + sws_flags_str[strlen(sws_flags_str)-1] = '\0'; - av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags); - snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags); graph->scale_sws_opts = av_strdup(sws_flags_str); snprintf(buffersrc_args, sizeof(buffersrc_args), |