History

fftools/ffmpeg_mux_init: move the ost_get_filters() call to ost_bind_filter()

That is a more appropriate place for it.

Anton Khirnov committed 2 years ago

Commit ba06c7b1 parent 71916aa1 file · +9 −9Browse files

Unified · Split

fftools/ffmpeg_mux_init.c+9−9
@@ -896,7 +896,7 @@ static int new_stream_subtitle(Muxer *mux, const OptionsContext *o, · 895 unmodified lines
896896
897897 static int
898898 ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
899− const OptionsContext *o, char *filters,
899+ const OptionsContext *o,
900900 AVRational enc_tb, enum VideoSyncMethod vsync_method,
901901 int keep_pix_fmt, int autoscale, int threads_manual,
902902 const ViewSpecifier *vs)
@@ -904,6 +904,7 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter, · 1 unmodified line
904904 OutputStream *ost = &ms->ost;
905905 AVCodecContext *enc_ctx = ost->enc->enc_ctx;
906906 char name[16];
907+ char *filters = NULL;
907908 int ret;
908909
909910 OutputFilterOptions opts = {
@@ -985,7 +986,12 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter, · 75 unmodified lines
985986 return ret;
986987 }
987988
989+ ret = ost_get_filters(o, mux->fc, ost, &filters);
990+ if (ret < 0)
991+ return ret;
992+
988993 if (ofilter) {
994+ av_assert0(!filters);
989995 ost->filter = ofilter;
990996 ret = ofilter_bind_enc(ofilter, ms->sch_idx_enc, &opts);
991997 } else {
@@ -1188,7 +1194,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 196 unmodified lines
11881194 AVRational enc_tb = { 0, 0 };
11891195 enum VideoSyncMethod vsync_method = VSYNC_AUTO;
11901196 const char *bsfs = NULL, *time_base = NULL, *codec_tag = NULL;
1191− char *filters = NULL, *next;
1197+ char *next;
11921198 double qscale = -1;
11931199
11941200 st = avformat_new_stream(oc, NULL);
@@ -1526,15 +1532,9 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 331 unmodified lines
15261532 if (ret < 0)
15271533 goto fail;
15281534
1529− if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) {
1530− ret = ost_get_filters(o, oc, ost, &filters);
1531− if (ret < 0)
1532− goto fail;
1533− }
1534−
15351535 if (ost->enc &&
15361536 (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {
1537− ret = ost_bind_filter(mux, ms, ofilter, o, filters, enc_tb, vsync_method,
1537+ ret = ost_bind_filter(mux, ms, ofilter, o, enc_tb, vsync_method,
15381538 keep_pix_fmt, autoscale, threads_manual, vs);
15391539 if (ret < 0)
15401540 goto fail;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t