summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-07 18:07:43 +0200
committerwm4 <wm4@nowhere>2014-08-07 18:07:43 +0200
commit886ac0969984aade981f0a3b948f9497cd76b3a1 (patch)
tree089219d05dea05fddaa622c89b061f40421e0d6a
parent483595e2d44fa75a6beab3030c0edbbf5ff813a4 (diff)
downloadmpv-886ac0969984aade981f0a3b948f9497cd76b3a1.tar.bz2
mpv-886ac0969984aade981f0a3b948f9497cd76b3a1.tar.xz
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.
-rw-r--r--player/video.c3
1 files changed, 2 insertions, 1 deletions
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);