diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-07 18:50:15 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-05-15 13:32:02 +0200 |
commit | ab223a4d8cdcbf3b7b6b9b6c3ecc95203a342f5c (patch) | |
tree | 3691581dbedee3f4b75ac556044d3f3820995426 /fftools/ffmpeg.c | |
parent | 2ab9f247f7feb23bc9765dcbcc574687552fcea6 (diff) | |
download | ffmpeg-ab223a4d8cdcbf3b7b6b9b6c3ecc95203a342f5c.tar.gz |
fftools/ffmpeg: stop accessing input format from decoding code
Export the corresponding flag in InputFile instead. This will allow
making the demuxer AVFormatContext private in future commits, similarly
to what was previously done for muxers.
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r-- | fftools/ffmpeg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 092c5e179a..45efa75047 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -976,7 +976,6 @@ static int decode_audio(InputStream *ist, const AVPacket *pkt, int *got_output, static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *frame) { const InputFile *ifile = input_files[ist->file_index]; - const int container_nots = !!(ifile->ctx->iformat->flags & AVFMT_NOTIMESTAMPS); int64_t codec_duration = 0; // XXX lavf currently makes up frame durations when they are not provided by @@ -986,7 +985,7 @@ static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *fr // durations, then this should be simplified. // prefer frame duration for containers with timestamps - if (frame->duration > 0 && !container_nots) + if (frame->duration > 0 && !ifile->format_nots) return frame->duration; if (ist->dec_ctx->framerate.den && ist->dec_ctx->framerate.num) { @@ -998,7 +997,7 @@ static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *fr } // prefer codec-layer duration for containers without timestamps - if (codec_duration > 0 && container_nots) + if (codec_duration > 0 && ifile->format_nots) return codec_duration; // when timestamps are available, repeat last frame's actual duration |