summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-29 10:20:50 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-29 10:20:50 +0100
commit5dacabb5bf3372107e032f3a90555c3c7f9cb6a7 (patch)
tree7c9325c3a4e6d3fcbc15a9396e8be0ae5dc9d3d7 /src/lib/ffmpeg_decoder.cc
parentb08f08eadf8692202af93e385de93b210b7cd5f4 (diff)
Make sure we round properly when deciding how many audio frames to discard.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 7923be59b..c23d56b42 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -337,7 +337,7 @@ FFmpegDecoder::decode_audio_packet ()
if (ct < ContentTime ()) {
/* Discard audio data that comes before time 0 */
- Frame const remove = min (int64_t (data->frames()), -ct.frames_round ((*stream)->frame_rate ()));
+ Frame const remove = min (int64_t (data->frames()), (-ct).frames_ceil(double((*stream)->frame_rate ())));
data->move (remove, 0, data->frames() - remove);
data->set_frames (data->frames() - remove);
ct += ContentTime::from_frames (remove, (*stream)->frame_rate ());