X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=avconv_filter.c;h=e54da56c7a0fdc8b7984fd3e3553264d5652e791;hb=58ae8d595724150c407ca2c2df3aa4bd5580397c;hp=c667992165a25f0d7d799f027933948b4b2b5f74;hpb=41776ba9c0ebbb71394cefdf7dd1b243e6c852d5;p=ffmpeg diff --git a/avconv_filter.c b/avconv_filter.c index c667992165a..e54da56c7a0 100644 --- a/avconv_filter.c +++ b/avconv_filter.c @@ -39,8 +39,8 @@ #define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name) \ static char *choose_ ## var ## s(OutputStream *ost) \ { \ - if (ost->st->codec->var != none) { \ - get_name(ost->st->codec->var); \ + if (ost->enc_ctx->var != none) { \ + get_name(ost->enc_ctx->var); \ return av_strdup(name); \ } else if (ost->enc && ost->enc->supported_list) { \ const type *p; \ @@ -231,7 +231,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, char *pix_fmts; OutputStream *ost = ofilter->ost; OutputFile *of = output_files[ost->file_index]; - AVCodecContext *codec = ost->st->codec; + AVCodecContext *codec = ost->enc_ctx; AVFilterContext *last_filter = out->filter_ctx; int pad_idx = out->pad_idx; int ret; @@ -268,17 +268,17 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterContext *filter; snprintf(name, sizeof(name), "pixel format for output stream %d:%d", ost->file_index, ost->index); - if ((ret = avfilter_graph_create_filter(&filter, - avfilter_get_by_name("format"), - "format", pix_fmts, NULL, - fg->graph)) < 0) + ret = avfilter_graph_create_filter(&filter, + avfilter_get_by_name("format"), + "format", pix_fmts, NULL, fg->graph); + av_freep(&pix_fmts); + if (ret < 0) return ret; if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0) return ret; last_filter = filter; pad_idx = 0; - av_freep(&pix_fmts); } if (ost->frame_rate.num) { @@ -319,7 +319,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, { OutputStream *ost = ofilter->ost; OutputFile *of = output_files[ost->file_index]; - AVCodecContext *codec = ost->st->codec; + AVCodecContext *codec = ost->enc_ctx; AVFilterContext *last_filter = out->filter_ctx; int pad_idx = out->pad_idx; char *sample_fmts, *sample_rates, *channel_layouts;