[vlc-devel] commit: Add ACCESS_OUT_CAN_CONTROL_PACE, fix AccessOutControl prototype ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Aug 29 17:52:58 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Aug 29 18:13:19 2008 +0300| [c8a5be75a55d0a5dbda485f39c9f52c8de6fed06] | committer: Rémi Denis-Courmont 

Add ACCESS_OUT_CAN_CONTROL_PACE, fix AccessOutControl prototype

(My fault - fortunately, sout_AccessOutControl was unused)

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

 include/vlc_sout.h                |   20 +++++++++++++++++---
 src/stream_output/stream_output.c |   14 +++++++++++---
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 811146f..45856a4 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -1,13 +1,14 @@
 /*****************************************************************************
  * stream_output.h : stream output module
  *****************************************************************************
- * Copyright (C) 2002-2007 the VideoLAN team
+ * Copyright (C) 2002-2008 the VideoLAN team
  * $Id$
  *
  * Authors: Christophe Massiot <massiot at via.ecp.fr>
  *          Laurent Aimar <fenrir at via.ecp.fr>
  *          Eric Petit <titer at videolan.org>
  *          Jean-Paul Saman <jpsaman #_at_# m2x.nl>
+ *          Rémi Denis-Courmont
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -98,16 +99,29 @@ struct sout_access_out_t
     ssize_t                 (*pf_write)( sout_access_out_t *, block_t * );
     int                     (*pf_control)( sout_access_out_t *, int, va_list);
 
-    config_chain_t              *p_cfg;
+    config_chain_t          *p_cfg;
     sout_instance_t         *p_sout;
 };
 
+enum access_out_query_e
+{
+    ACCESS_OUT_CONTROLS_PACE, /* arg1=bool *, can fail (assume true) */
+};
+
 VLC_EXPORT( sout_access_out_t *,sout_AccessOutNew, ( sout_instance_t *, const char *psz_access, const char *psz_name ) );
 VLC_EXPORT( void,               sout_AccessOutDelete, ( sout_access_out_t * ) );
 VLC_EXPORT( int,                sout_AccessOutSeek,   ( sout_access_out_t *, off_t ) );
 VLC_EXPORT( ssize_t,            sout_AccessOutRead,   ( sout_access_out_t *, block_t * ) );
 VLC_EXPORT( ssize_t,            sout_AccessOutWrite,  ( sout_access_out_t *, block_t * ) );
-VLC_EXPORT( int,                sout_AccessOutControl,( sout_access_out_t *, int, va_list ) );
+VLC_EXPORT( int,                sout_AccessOutControl,( sout_access_out_t *, int, ... ) );
+
+static inline bool sout_AccessOutCanControlPace( sout_access_out_t *p_ao )
+{
+    bool b;
+    if( sout_AccessOutControl( p_ao, ACCESS_OUT_CONTROLS_PACE, &b ) )
+        return true;
+    return b;
+}
 
 /** Muxer structure */
 struct  sout_mux_t
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 0ac9fd5..b52bc97 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -390,10 +390,18 @@ ssize_t sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer )
 /**
  * sout_AccessOutControl
  */
-int sout_AccessOutControl (sout_access_out_t *access, int query, va_list args)
+int sout_AccessOutControl (sout_access_out_t *access, int query, ...)
 {
-    return (access->pf_control) ? access->pf_control (access, query, args)
-                                : VLC_EGENERIC;
+    va_list ap;
+    int ret;
+
+    va_start (ap, query);
+    if (access->pf_control)
+        ret = access->pf_control (access, query, ap);
+    else
+        ret = VLC_EGENERIC;
+    va_end (ap);
+    return ret;
 }
 
 /*****************************************************************************




More information about the vlc-devel mailing list