diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-01 11:04:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-01 11:04:17 +0100 |
| commit | 3d6eaf43f7c75fe4d47c1ed1c63366f24cde51fe (patch) | |
| tree | 46681bffab4e3ed86872c1bec44d6f4fd14406fa /src/lib | |
| parent | a938cc151afdfc9962af3e318d6e9b81ca00563b (diff) | |
Fix crash with multiple audio streams.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 1d2f20fe6..cc6a703ba 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -54,6 +54,7 @@ using std::list; using std::cout; using std::pair; using std::make_pair; +using std::max; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; @@ -331,7 +332,13 @@ FFmpegContent::full_length () const } DCPOMATIC_ASSERT (audio); - return DCPTime::from_frames (llrint (audio->stream()->length() / frc.speed_up), audio->stream()->frame_rate()); + + DCPTime longest; + BOOST_FOREACH (AudioStreamPtr i, audio->streams ()) { + longest = max (longest, DCPTime::from_frames (llrint (i->length() / frc.speed_up), i->frame_rate())); + } + + return longest; } void |
