[vlc-commits] core: vout: add vout_OSDMessageVA

Victorien Le Couviour--Tuffet git at videolan.org
Thu Nov 15 16:23:28 CET 2018


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Mon Nov  5 11:19:11 2018 +0100| [bed6635bbe76d0aaea00355e3693ab34f12d1907] | committer: Thomas Guillem

core: vout: add vout_OSDMessageVA

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 include/vlc_vout_osd.h        | 12 +++++++++++-
 src/libvlccore.sym            |  2 +-
 src/video_output/video_text.c |  8 ++------
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/vlc_vout_osd.h b/include/vlc_vout_osd.h
index a97b068f85..e8228a1866 100644
--- a/include/vlc_vout_osd.h
+++ b/include/vlc_vout_osd.h
@@ -71,10 +71,20 @@ VLC_API void vout_OSDText( vout_thread_t *vout, int channel, int position, vlc_t
  * \param vout The vout on which the message will be displayed
  * \param channel Subpicture channel
  * \param format printf style formatting
+ * \param args format argument list
  *
  * Provided for convenience.
  */
-VLC_API void vout_OSDMessage( vout_thread_t *, int, const char *, ... ) VLC_FORMAT( 3, 4 );
+VLC_API void vout_OSDMessageVa(vout_thread_t *, int, const char *, va_list);
+
+static inline void
+vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+{
+    va_list args;
+    va_start(args, format);
+    vout_OSDMessageVa(vout, channel, format, args);
+    va_end(args);
+}
 
 /**
  * Display a slider on the video output.
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 6c89bc65c0..4beb6c0e02 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -737,7 +737,7 @@ vout_RegisterSubpictureChannel
 vout_FlushSubpictureChannel
 vout_GetSnapshot
 vout_OSDIcon
-vout_OSDMessage
+vout_OSDMessageVa
 vout_OSDEpg
 vout_OSDSlider
 vout_OSDText
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 10de062aa8..19aff57b4f 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -144,11 +144,9 @@ void vout_OSDText(vout_thread_t *vout, int channel,
     vout_PutSubpicture(vout, subpic);
 }
 
-void vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
+void vout_OSDMessageVa(vout_thread_t *vout, int channel,
+                       const char *format, va_list args)
 {
-    va_list args;
-    va_start(args, format);
-
     char *string;
     if (vasprintf(&string, format, args) != -1) {
         vout_OSDText(vout, channel,
@@ -156,6 +154,4 @@ void vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
                      string);
         free(string);
     }
-    va_end(args);
 }
-



More information about the vlc-commits mailing list