[vlc-commits] aout: always provide time_get

Rémi Denis-Courmont git at videolan.org
Sat May 5 17:07:54 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May  5 17:37:32 2018 +0300| [4878b1a872064d904b50a471de6555e4236217e8] | committer: Rémi Denis-Courmont

aout: always provide time_get

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

 include/vlc_aout.h            | 10 ++++++++++
 modules/audio_output/adummy.c |  2 +-
 modules/audio_output/amem.c   |  2 +-
 modules/audio_output/file.c   |  2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 25063bdfab..2f03016986 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -417,6 +417,16 @@ static inline void aout_RestartRequest(audio_output_t *aout, unsigned mode)
     aout->events->restart_request(aout, mode);
 }
 
+/**
+ * Default implementation for audio_output_t.time_get
+ */
+static inline int aout_TimeGetDefault(audio_output_t *aout,
+                                      mtime_t *restrict delay)
+{
+    (void) aout; (void) delay;
+    return -1;
+}
+
 /* Audio output filters */
 
 typedef struct
diff --git a/modules/audio_output/adummy.c b/modules/audio_output/adummy.c
index fbec096b25..ac1ea71110 100644
--- a/modules/audio_output/adummy.c
+++ b/modules/audio_output/adummy.c
@@ -89,7 +89,7 @@ static int Open(vlc_object_t *obj)
     audio_output_t *aout = (audio_output_t *)obj;
 
     aout->start = Start;
-    aout->time_get = NULL;
+    aout->time_get = aout_TimeGetDefault;
     aout->play = Play;
     aout->pause = NULL;
     aout->flush = Flush;
diff --git a/modules/audio_output/amem.c b/modules/audio_output/amem.c
index 26e7d4e8a6..82d270710e 100644
--- a/modules/audio_output/amem.c
+++ b/modules/audio_output/amem.c
@@ -309,7 +309,7 @@ static int Open (vlc_object_t *obj)
     aout->sys = sys;
     aout->start = Start;
     aout->stop = Stop;
-    aout->time_get = NULL;
+    aout->time_get = aout_TimeGetDefault;
     aout->play = Play;
     aout->pause = Pause;
     aout->flush = Flush;
diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c
index 77bca519f0..f362c9a854 100644
--- a/modules/audio_output/file.c
+++ b/modules/audio_output/file.c
@@ -163,7 +163,7 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
         return VLC_EGENERIC;
     }
 
-    p_aout->time_get = NULL;
+    p_aout->time_get = aout_TimeGetDefault;
     p_aout->play = Play;
     p_aout->pause = NULL;
     p_aout->flush = Flush;



More information about the vlc-commits mailing list