diff options
Diffstat (limited to 'src/lib/audio_decoder.cc')
| -rw-r--r-- | src/lib/audio_decoder.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 61ff5d265..60b0f07ad 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -64,9 +64,10 @@ AudioDecoder::emit(shared_ptr<const Film> film, AudioStreamPtr stream, shared_pt } /* Amount of error we will tolerate on audio timestamps; see comment below. - * We'll use 1 24fps video frame as this seems to be roughly how ffplay does it. + * ffplay seems to use 1 24fps video frame, but I was sent a file that played + * fine in VLC but not here until the slack was increased to 4 frames @ 24fps. */ - Frame const slack_frames = resampled_rate / 24; + Frame const slack_frames = 4 * resampled_rate / 24; /* first_since_seek is set to true if this is the first data we have received since initialisation or seek. We'll set the position based @@ -83,10 +84,11 @@ AudioDecoder::emit(shared_ptr<const Film> film, AudioStreamPtr stream, shared_pt if (need_reset) { LOG_GENERAL ( - "Reset audio position: was %1, new data at %2, slack: %3 frames", + "Reset audio position: was %1, new data at %2, slack: %3 frames (more than threshold %4)", _positions[stream], time.frames_round(resampled_rate), - std::abs(_positions[stream] - time.frames_round(resampled_rate)) + std::abs(_positions[stream] - time.frames_round(resampled_rate)), + slack_frames ); } |
