aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/demux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-10-13 13:08:10 +0200
committerAnton Khirnov <anton@khirnov.net>2024-10-16 16:46:29 +0200
commit86460a0342d7cbd59ad794f515d7d525331b54dd (patch)
treee3e0ff4126c5bad930943a40d06f391ced2b4840 /libavformat/demux.c
parent31da5222a400a385c0633c54e20b0ae1b30730df (diff)
downloadffmpeg-86460a0342d7cbd59ad794f515d7d525331b54dd.tar.gz
lavf/flvdec: replace a private option with a field in FFFormatContext
The demuxer's 'missing_streams' private option is used to communicate information from the demuxer to avformat_find_stream_info(). However, that is not only unnecessarily complicated, it also leaks internal information to users, e.g. this option appears in the results of the fate-flv-demux test. Use a new field in FFFormatContext to communicate this information instead.
Diffstat (limited to 'libavformat/demux.c')
-rw-r--r--libavformat/demux.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/libavformat/demux.c b/libavformat/demux.c
index f9517454ad..cba1f2e4df 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2537,7 +2537,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
int64_t max_subtitle_analyze_duration;
int64_t probesize = ic->probesize;
int eof_reached = 0;
- int *missing_streams = av_opt_ptr(ic->iformat->priv_class, ic->priv_data, "missing_streams");
flush_codecs = probesize > 0;
@@ -2676,19 +2675,18 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
analyzed_all_streams = 0;
- if (!missing_streams || !*missing_streams)
- if (i == ic->nb_streams) {
- analyzed_all_streams = 1;
- /* NOTE: If the format has no header, then we need to read some
- * packets to get most of the streams, so we cannot stop here. */
- if (!(ic->ctx_flags & AVFMTCTX_NOHEADER)) {
- /* If we found the info for all the codecs, we can stop. */
- ret = count;
- av_log(ic, AV_LOG_DEBUG, "All info found\n");
- flush_codecs = 0;
- break;
- }
+ if (i == ic->nb_streams && !si->missing_streams) {
+ analyzed_all_streams = 1;
+ /* NOTE: If the format has no header, then we need to read some
+ * packets to get most of the streams, so we cannot stop here. */
+ if (!(ic->ctx_flags & AVFMTCTX_NOHEADER)) {
+ /* If we found the info for all the codecs, we can stop. */
+ ret = count;
+ av_log(ic, AV_LOG_DEBUG, "All info found\n");
+ flush_codecs = 0;
+ break;
}
+ }
/* We did not get all the codec info, but we read too much data. */
if (read_size >= probesize) {
ret = count;