Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-08-13 18:03:39 +0300
committerAnton Khirnov <anton@khirnov.net>2022-08-16 12:09:09 +0300
commitab3147383006f1a31978efce23c6bad38a754e05 (patch)
tree379dc0de3405d1ba2d96d887086ab8cd39b1a116 /fftools/ffmpeg.h
parent75ffca7eef557bcc714d924048a6e184b39fa470 (diff)
fftools/ffmpeg: store a separate copy of input codec parameters
Use it instead of AVStream.codecpar in the main thread. While AVStream.codecpar is documented to only be updated when the stream is added or avformat_find_stream_info(), it is actually updated during demuxing. Accessing it from a different thread then constitutes a race. Ideally, some mechanism should eventually be provided for signalling parameter updates to the user. Then the demuxing thread could pick up the changes and propagate them to the decoder.
Diffstat (limited to 'fftools/ffmpeg.h')
-rw-r--r--fftools/ffmpeg.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 6991ba7632..44cc23fa84 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -323,6 +323,12 @@ typedef struct InputStream {
#define DECODING_FOR_FILTER 2
int processing_needed; /* non zero if the packets must be processed */
+ /**
+ * Codec parameters - to be used by the decoding/streamcopy code.
+ * st->codecpar should not be accessed, because it may be modified
+ * concurrently by the demuxing thread.
+ */
+ AVCodecParameters *par;
AVCodecContext *dec_ctx;
const AVCodec *dec;
AVFrame *decoded_frame;