summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-16 12:38:06 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-16 12:38:06 +0200
commit5c5da23c412e9b922154f8934e16f3a51ff48bdc (patch)
tree9d99c8e73cd8e9cc86853e5a463d2c0a99f5c6ab /src/lib/audio_decoder.cc
parent950b0eee7664caea3c62708a3f05614ee1fc7a8a (diff)
Increase tolerance for audio timestamp error.
This makes a seemingly valid file that I was sent play properly.
Diffstat (limited to 'src/lib/audio_decoder.cc')
-rw-r--r--src/lib/audio_decoder.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index dbed0a406..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