diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-11-17 09:49:27 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-11-23 10:36:23 +0100 |
commit | fd8bf8d3b52b683d203bfe02c6972e63199ac4f4 (patch) | |
tree | 858d6f03be0da62771c2a5b0a9d8de3a5110b501 /fftools/ffmpeg.h | |
parent | 86e2ffedfe343f8e2878db84fefef0d85ebfe0dc (diff) | |
download | ffmpeg-fd8bf8d3b52b683d203bfe02c6972e63199ac4f4.tar.gz |
fftools/ffmpeg: remove the input_streams global
Replace it with an array of streams in each InputFile. This is a more
accurate reflection of the actual relationship between InputStream and
InputFile.
Analogous to what was previously done to output streams in
7ef7a22251b852faab9404c85399ba8ac5dfbdc3.
Diffstat (limited to 'fftools/ffmpeg.h')
-rw-r--r-- | fftools/ffmpeg.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index b1e466406d..5fc3b2d3d4 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -437,7 +437,6 @@ typedef struct InputFile { AVFormatContext *ctx; int eof_reached; /* true if eof reached */ int eagain; /* true if last read attempt returned EAGAIN */ - int ist_index; /* index of first stream in input_streams */ int64_t input_ts_offset; int input_sync_ref; /** @@ -452,8 +451,13 @@ typedef struct InputFile { int64_t last_ts; int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */ int64_t recording_time; - int nb_streams; /* number of stream that ffmpeg is aware of; may be different - from ctx.nb_streams if new streams appear during av_read_frame() */ + + /* streams that ffmpeg is aware of; + * there may be extra streams in ctx that are not mapped to an InputStream + * if new streams appear dynamically during demuxing */ + InputStream **streams; + int nb_streams; + int rate_emu; float readrate; int accurate_seek; @@ -629,8 +633,6 @@ typedef struct OutputFile { int bitexact; } OutputFile; -extern InputStream **input_streams; -extern int nb_input_streams; extern InputFile **input_files; extern int nb_input_files; @@ -766,6 +768,10 @@ void ifile_close(InputFile **f); */ int ifile_get_packet(InputFile *f, AVPacket **pkt); +/* iterate over all input streams in all input files; + * pass NULL to start iteration */ +InputStream *ist_iter(InputStream *prev); + #define SPECIFIER_OPT_FMT_str "%s" #define SPECIFIER_OPT_FMT_i "%i" #define SPECIFIER_OPT_FMT_i64 "%"PRId64 |