summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-25 21:28:56 +0200
committerwm4 <wm4@nowhere>2014-08-25 21:39:24 +0200
commitf104ef12827278c5620b57a34d066b333bbdfa32 (patch)
treecbdffdf6c6a265b49c18130546f34578f06e471f /player/audio.c
parentf4ccf22e1695e89fb6fcf97f92fc492a2bdc5b97 (diff)
downloadmpv-f104ef12827278c5620b57a34d066b333bbdfa32.tar.bz2
mpv-f104ef12827278c5620b57a34d066b333bbdfa32.tar.xz
player: minor changes
This shouldn't change anything functionally. Change the A/V desync message. --framedrop is enabled by default now, so the text must be changed a little. I've never heard of audio outputs messing up A/V sync recently, so remove that part. Remove the unused ao_pts field. Reorder 2 A/V sync related expressions so that they look the same.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/player/audio.c b/player/audio.c
index a044a422cc..cc5629a6e6 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -276,7 +276,6 @@ static int write_to_ao(struct MPContext *mpctx, struct mp_audio *data, int flags
struct ao *ao = mpctx->ao;
struct mp_audio out_format;
ao_get_format(ao, &out_format);
- mpctx->ao_pts = pts;
#if HAVE_ENCODING
encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, playing_audio_pts(mpctx));
#endif
@@ -288,9 +287,6 @@ static int write_to_ao(struct MPContext *mpctx, struct mp_audio *data, int flags
if (played > 0) {
mpctx->shown_aframes += played;
mpctx->delay += played / real_samplerate;
- // Keep correct pts for remaining data - could be used to flush
- // remaining buffer when closing ao.
- mpctx->ao_pts += played / real_samplerate;
return played;
}
return 0;
@@ -343,7 +339,7 @@ static bool get_sync_samples(struct MPContext *mpctx, int *skip)
}
if (sync_to_video)
- sync_pts += mpctx->delay - mpctx->audio_delay;
+ sync_pts -= mpctx->audio_delay - mpctx->delay;
double ptsdiff = written_pts - sync_pts;
// Missing timestamp, or PTS reset, or just broken.