diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-04-19 00:34:03 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-04-19 00:34:03 +0000 |
| commit | 64ff57b866e19daa8ed16b08d0a8038f787948c1 (patch) | |
| tree | fa610410f081e568854a971ec02987b8328b8772 /src/lib/butler.cc | |
| parent | 5fc68cc97134b5d49479dadff05725124e56a513 (diff) | |
Hopefully better errors on large video/audio disagreements.
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index e15cb9d3f..11ee033e9 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -124,14 +124,26 @@ Butler::should_run () const { if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 10) { /* This is way too big */ - throw ProgrammingError - (__FILE__, __LINE__, String::compose ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size())); + optional<DCPTime> pos = _audio.peek(); + if (pos) { + throw ProgrammingError + (__FILE__, __LINE__, String::compose ("Butler video buffers reached %1 frames (audio is %2 at %3)", _video.size(), _audio.size(), pos->get())); + } else { + throw ProgrammingError + (__FILE__, __LINE__, String::compose ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size())); + } } if (_audio.size() >= MAXIMUM_AUDIO_READAHEAD * 10) { /* This is way too big */ - throw ProgrammingError - (__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames (video is %2)", _audio.size(), _video.size())); + optional<DCPTime> pos = _audio.peek(); + if (pos) { + throw ProgrammingError + (__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames at %2 (video is %3)", _audio.size(), pos->get(), _video.size())); + } else { + throw ProgrammingError + (__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames (video is %3)", _audio.size(), _video.size())); + } } if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 2) { |
