[vlc-commits] ALSA: measure time from start (refs #7400)

Rémi Denis-Courmont git at videolan.org
Mon Sep 3 15:31:04 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep  3 16:31:10 2012 +0300| [93d4bf96f5f86f4056d0b7a7f7b7fd297606a637] | committer: Rémi Denis-Courmont

ALSA: measure time from start (refs #7400)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93d4bf96f5f86f4056d0b7a7f7b7fd297606a637
---

 modules/access/alsa.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index 5b5a4e6..41c4036 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -128,6 +128,7 @@ struct demux_sys_t
     es_out_id_t *es;
     vlc_thread_t thread;
 
+    mtime_t start;
     mtime_t caching;
     snd_pcm_uframes_t period_size;
     unsigned rate;
@@ -224,7 +225,7 @@ static int Control (demux_t *demux, int query, va_list ap)
     switch (query)
     {
         case DEMUX_GET_TIME:
-            *va_arg (ap, int64_t *) = mdate();
+            *va_arg (ap, int64_t *) = mdate () - sys->start;
             break;
 
         case DEMUX_GET_PTS_DELAY:
@@ -442,6 +443,7 @@ static int Open (vlc_object_t *obj)
     fmt.audio.i_rate = param;
     sys->rate = param;
 
+    sys->start = mdate ();
     sys->caching = INT64_C(1000) * var_InheritInteger (demux, "live-caching");
     param = sys->caching;
     val = snd_pcm_hw_params_set_buffer_time_near (pcm, hw, &param, NULL);



More information about the vlc-commits mailing list