From 886ac0969984aade981f0a3b948f9497cd76b3a1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 Aug 2014 18:07:43 +0200 Subject: audio: fix encoding mode If this code is not skipped, encoding (or dumping with --ao=pcm) will attempt to adjust video timing to audio. Since another commit (0cce8fe6) already avoids writing audio ahead, this didn't slow down encoding to realtime, but it was still significantly slower. This change should actually remove all extra sleeping. --- player/video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/video.c b/player/video.c index 23c49f7ae3..21101f501a 100644 --- a/player/video.c +++ b/player/video.c @@ -776,7 +776,8 @@ void write_video(struct MPContext *mpctx, double endpts) if (!mpctx->sync_audio_to_video || mpctx->video_status < STATUS_READY) { mpctx->time_frame = 0; } else if (mpctx->audio_status == STATUS_PLAYING && - mpctx->video_status == STATUS_PLAYING) + mpctx->video_status == STATUS_PLAYING && + !ao_untimed(mpctx->ao)) { double buffered_audio = ao_get_delay(mpctx->ao); MP_TRACE(mpctx, "audio delay=%f\n", buffered_audio); -- cgit v1.2.3