diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-11-10 22:02:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-11-10 22:02:55 +0100 |
| commit | e2e7420bb4fc8ce36746ccddd6e2b29608de3a90 (patch) | |
| tree | bf9c354e76ff09e0574ecaa5496e2709038b6ace /src/lib/ffmpeg_examiner.cc | |
| parent | ed8c710521f9d2d1c3a5683987afbb045ff8773f (diff) | |
| parent | 247191469093427b05229bd0051c25395a30f4b5 (diff) | |
Merge remote-tracking branch 'origin/main' into v2.17.x
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 8fa49770b..ca85ae3c5 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -91,7 +91,6 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo } if (has_video ()) { - /* See if the header has duration information in it */ _video_length = _need_length ? 0 : llrint((double (_format_context->duration) / AV_TIME_BASE) * video_frame_rate().get()); } @@ -112,8 +111,8 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo * and a string seems a reasonably neat way to do that. */ string temporal_reference; - bool carry_on_video = false; - std::vector<bool> carry_on_audio(_audio_streams.size()); + bool carry_on_video = has_video(); + std::vector<bool> carry_on_audio(_audio_streams.size(), true); while (true) { auto packet = av_packet_alloc (); DCPOMATIC_ASSERT (packet); @@ -152,9 +151,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo } if (audio_stream_index) { - if (audio_packet(context, _audio_streams[*audio_stream_index], packet)) { - carry_on_audio[*audio_stream_index] = true; - } + carry_on_audio[*audio_stream_index] = audio_packet(context, _audio_streams[*audio_stream_index], packet); } av_packet_free (&packet); |
