summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_mux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-13 14:27:40 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-17 12:01:40 +0200
commit150c992490d723124f05c77425aa8689dbcbbebc (patch)
tree091c1046fd3e68c73e68a866a4437acca4273367 /fftools/ffmpeg_mux.c
parent2178ff2162ba4898c5f1cc3f334b00392451efd6 (diff)
downloadffmpeg-150c992490d723124f05c77425aa8689dbcbbebc.tar.gz
fftools/ffmpeg_mux: use output stream parameters in of_streamcopy()
They should always be the same as the input stream parameters, but this reduces the need to access InputStream in muxing code.
Diffstat (limited to 'fftools/ffmpeg_mux.c')
-rw-r--r--fftools/ffmpeg_mux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 96ed50f73c..db6ad9d589 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -425,11 +425,11 @@ void of_streamcopy(InputStream *ist, OutputStream *ost,
if (pkt->dts == AV_NOPTS_VALUE) {
opkt->dts = av_rescale_q(dts, AV_TIME_BASE_Q, opkt->time_base);
} else if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
- int duration = av_get_audio_frame_duration2(ist->par, pkt->size);
+ int duration = av_get_audio_frame_duration2(ost->par_in, pkt->size);
if(!duration)
- duration = ist->par->frame_size;
+ duration = ost->par_in->frame_size;
opkt->dts = av_rescale_delta(pkt->time_base, pkt->dts,
- (AVRational){1, ist->par->sample_rate}, duration,
+ (AVRational){1, ost->par_in->sample_rate}, duration,
&ist->filter_in_rescale_delta_last, opkt->time_base);
/* dts will be set immediately afterwards to what pts is now */
opkt->pts = opkt->dts - ost_tb_start_time;