diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index cc72b1cb6e..25c33cf207 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -659,7 +659,6 @@ typedef struct OutputStream { const char *attachment_filename; int copy_initial_nonkeyframes; - int copy_prior_start; int keep_pix_fmt; diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 01ccac55ce..f52205cf30 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -398,7 +398,7 @@ void of_streamcopy(OutputStream *ost, const AVPacket *pkt, int64_t dts) return; if (!ms->streamcopy_started) { - if (!ost->copy_prior_start && + if (!ms->copy_prior_start && (pkt->pts == AV_NOPTS_VALUE ? dts < ms->ts_copy_start : pkt->pts < av_rescale_q(ms->ts_copy_start, AV_TIME_BASE_Q, pkt->time_base))) diff --git a/fftools/ffmpeg_mux.h b/fftools/ffmpeg_mux.h index 0938a261ee..81c4698161 100644 --- a/fftools/ffmpeg_mux.h +++ b/fftools/ffmpeg_mux.h @@ -75,6 +75,7 @@ typedef struct MuxStream { // combined size of all the packets sent to the muxer uint64_t data_size_mux; + int copy_prior_start; int streamcopy_started; } MuxStream; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 555ccfd796..51fdd88232 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -908,7 +908,7 @@ static int streamcopy_init(const Muxer *mux, const OptionsContext *o, if (ost->st->duration <= 0 && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); - if (!ost->copy_prior_start) { + if (!ms->copy_prior_start) { ms->ts_copy_start = (mux->of.start_time == AV_NOPTS_VALUE) ? 0 : mux->of.start_time; if (copy_ts && ifile->start_time != AV_NOPTS_VALUE) { @@ -1156,8 +1156,8 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, } } - ost->copy_prior_start = -1; - MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st); + ms->copy_prior_start = -1; + MATCH_PER_STREAM_OPT(copy_prior_start, i, ms->copy_prior_start, oc ,st); MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st); if (bsfs && *bsfs) {