summaryrefslogtreecommitdiff
path: root/codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'codec.c')
-rw-r--r--codec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/codec.c b/codec.c
index 400dd64..73776ff 100644
--- a/codec.c
+++ b/codec.c
@@ -931,7 +931,12 @@ static void CodecAudioSetClock(AudioDecoder * audio_decoder, int64_t pts)
if (audio_decoder->AvResample && audio_decoder->DriftCorr) {
int distance;
- distance = (pts_diff * audio_decoder->HwSampleRate) / (90 * 1000);
+ // try workaround for buggy ffmpeg 0.10
+ if (audio_decoder->DriftCorr < 2000) {
+ distance = (pts_diff * audio_decoder->HwSampleRate) / (900 * 1000);
+ } else {
+ distance = (pts_diff * audio_decoder->HwSampleRate) / (90 * 1000);
+ }
av_resample_compensate(audio_decoder->AvResample,
audio_decoder->DriftCorr / 10, distance);
}