[vlc-commits] wasapi: fix check for invalid position
Rémi Denis-Courmont
git at videolan.org
Tue Nov 13 21:06:59 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 13 22:06:44 2012 +0200| [606ac518d2468e5050bf04a589f168d41a63da72] | committer: Rémi Denis-Courmont
wasapi: fix check for invalid position
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=606ac518d2468e5050bf04a589f168d41a63da72
---
modules/audio_output/wasapi.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 08c9e6b..84009ac 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -153,12 +153,16 @@ static int TimeGet(audio_output_t *aout, mtime_t *restrict pts)
return -1;
}
+ if (pos == 0)
+ {
+ msg_Dbg(aout, "cannot compute position: still propagating buffers");
+ return -1;
+ }
+
mtime_t delay = ((GetQPC() - qpcpos) / (10000000 / CLOCK_FREQ));
static_assert((10000000 % CLOCK_FREQ) == 0, "Frequency conversion broken");
- if (delay < 1000) /* device is still buffering, time is screwed */
- return -1;
- *pts += mdate () + delay;
+ *pts += mdate() + delay;
return 0;
}
More information about the vlc-commits
mailing list