[vlc-devel] commit: es_out_SetDelay cannot fail. (Laurent Aimar )

git version control git at videolan.org
Sun Feb 14 18:11:29 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Feb 14 18:02:53 2010 +0100| [ccba67b5ee8f7a31d5a28714375c93a939c24aa6] | committer: Laurent Aimar 

es_out_SetDelay cannot fail.

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

 src/input/es_out.h |    7 ++++---
 src/input/input.c  |   16 ++++++----------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/input/es_out.h b/src/input/es_out.h
index 4fb3026..d6b2d30 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -58,7 +58,7 @@ enum es_out_query_private_e
     ES_OUT_GET_BUFFERING,                           /* arg1=bool*               res=cannot fail */
 
     /* Set delay for a ES category */
-    ES_OUT_SET_DELAY,                               /* arg1=es_category_e,      res=can fail */
+    ES_OUT_SET_DELAY,                               /* arg1=es_category_e,      res=cannot fail */
 
     /* Set record state */
     ES_OUT_SET_RECORD_STATE,                        /* arg1=bool                res=can fail */
@@ -111,9 +111,10 @@ static inline bool es_out_GetEmpty( es_out_t *p_out )
     assert( !i_ret );
     return b;
 }
-static inline int es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
+static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
 {
-    return es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
+    int i_ret = es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
+    assert( !i_ret );
 }
 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
 {
diff --git a/src/input/input.c b/src/input/input.c
index 9f99b60..9eb05d9 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1920,19 +1920,15 @@ static bool Control( input_thread_t *p_input,
             break;
 
         case INPUT_CONTROL_SET_AUDIO_DELAY:
-            if( !es_out_SetDelay( p_input->p->p_es_out_display, AUDIO_ES, val.i_time ) )
-            {
-                input_SendEventAudioDelay( p_input, val.i_time );
-                UpdatePtsDelay( p_input );
-            }
+            es_out_SetDelay( p_input->p->p_es_out_display, AUDIO_ES, val.i_time );
+            input_SendEventAudioDelay( p_input, val.i_time );
+            UpdatePtsDelay( p_input );
             break;
 
         case INPUT_CONTROL_SET_SPU_DELAY:
-            if( !es_out_SetDelay( p_input->p->p_es_out_display, SPU_ES, val.i_time ) )
-            {
-                input_SendEventSubtitleDelay( p_input, val.i_time );
-                UpdatePtsDelay( p_input );
-            }
+            es_out_SetDelay( p_input->p->p_es_out_display, SPU_ES, val.i_time );
+            input_SendEventSubtitleDelay( p_input, val.i_time );
+            UpdatePtsDelay( p_input );
             break;
 
         case INPUT_CONTROL_SET_TITLE:




More information about the vlc-devel mailing list