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
896 896
897static int897static int
898ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,898ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
899 const OptionsContext *o, char *filters,899 const OptionsContext *o,
900 AVRational enc_tb, enum VideoSyncMethod vsync_method,900 AVRational enc_tb, enum VideoSyncMethod vsync_method,
901 int keep_pix_fmt, int autoscale, int threads_manual,901 int keep_pix_fmt, int autoscale, int threads_manual,
902 const ViewSpecifier *vs)902 const ViewSpecifier *vs)
@@ -904,6 +904,7 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter, · 1 unmodified line
904 OutputStream *ost = &ms->ost;904 OutputStream *ost = &ms->ost;
905 AVCodecContext *enc_ctx = ost->enc->enc_ctx;905 AVCodecContext *enc_ctx = ost->enc->enc_ctx;
906 char name[16];906 char name[16];
907 char *filters = NULL;
907 int ret;908 int ret;
908 909
909 OutputFilterOptions opts = {910 OutputFilterOptions opts = {
@@ -985,7 +986,12 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter, · 75 unmodified lines
985 return ret;986 return ret;
986 }987 }
987 988
989 ret = ost_get_filters(o, mux->fc, ost, &filters);
990 if (ret < 0)
991 return ret;
992
988 if (ofilter) {993 if (ofilter) {
994 av_assert0(!filters);
989 ost->filter = ofilter;995 ost->filter = ofilter;
990 ret = ofilter_bind_enc(ofilter, ms->sch_idx_enc, &opts);996 ret = ofilter_bind_enc(ofilter, ms->sch_idx_enc, &opts);
991 } else {997 } else {
@@ -1188,7 +1194,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 196 unmodified lines
1188 AVRational enc_tb = { 0, 0 };1194 AVRational enc_tb = { 0, 0 };
1189 enum VideoSyncMethod vsync_method = VSYNC_AUTO;1195 enum VideoSyncMethod vsync_method = VSYNC_AUTO;
1190 const char *bsfs = NULL, *time_base = NULL, *codec_tag = NULL;1196 const char *bsfs = NULL, *time_base = NULL, *codec_tag = NULL;
1191 char *filters = NULL, *next;1197 char *next;
1192 double qscale = -1;1198 double qscale = -1;
1193 1199
1194 st = avformat_new_stream(oc, NULL);1200 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
1526 if (ret < 0)1532 if (ret < 0)
1527 goto fail;1533 goto fail;
1528 1534
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
1535 if (ost->enc &&1535 if (ost->enc &&
1536 (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {1536 (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,
1538 keep_pix_fmt, autoscale, threads_manual, vs);1538 keep_pix_fmt, autoscale, threads_manual, vs);
1539 if (ret < 0)1539 if (ret < 0)
1540 goto fail;1540 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