diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-10 15:06:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | 3db1df492e1009ee28641cdc593a139df156e8d7 (patch) | |
| tree | 7d86e74117a701515f381ee707d7699acab7b2dc /src/lib/ffmpeg_examiner.cc | |
| parent | 4fe27489ad67267081d048b45a4df9ee37541fde (diff) | |
Store audio length in AudioStream.
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 44d6a87df..bf9bafbfa 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -61,9 +61,17 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo s->codec->channel_layout = av_get_default_channel_layout (s->codec->channels); } + DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE); + _audio_streams.push_back ( shared_ptr<FFmpegAudioStream> ( - new FFmpegAudioStream (audio_stream_name (s), s->id, s->codec->sample_rate, s->codec->channels) + new FFmpegAudioStream ( + audio_stream_name (s), + s->id, + s->codec->sample_rate, + (double (_format_context->duration) / AV_TIME_BASE) * s->codec->sample_rate, + s->codec->channels + ) ) ); |
