[FFmpeg-cvslog] avformat/mux: Don't access AVStream's internal AVCodecContext

Andreas Rheinhardt git at videolan.org
Tue Aug 31 18:43:38 EEST 2021

ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Aug 26 20:07:36 2021 +0200| [bafb65ba2ab15a6c05ca73b2b0a82e23f57c30c6] | committer: Andreas Rheinhardt

avformat/mux: Don't access AVStream's internal AVCodecContext

An AVStream's internal AVCodecContext is pretty much unused for muxing:
The only place where any of its fields are set is
avformat_transfer_internal_stream_timing_info() where its time base is
set based upon the desired output format. The max_b_frames field is
never set at all, so don't read it in mux.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bafb65ba2ab15a6c05ca73b2b0a82e23f57c30c6

 libavformat/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 6fa1c5495b..b1ad0dd561 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
 //FIXME merge with compute_pkt_fields
 static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *pkt)
-    int delay = FFMAX(st->codecpar->video_delay, st->internal->avctx->max_b_frames > 0);
+    int delay = st->codecpar->video_delay;
     int i;
     int frame_size;

More information about the ffmpeg-cvslog mailing list