[vlc-commits] va: remove unused error return code

Rémi Denis-Courmont git at videolan.org
Sun Sep 27 21:57:46 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep 27 15:54:00 2015 +0300| [3f50af6a9207ff4bdba6500944bd5a418413e312] | committer: Rémi Denis-Courmont

va: remove unused error return code

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

 modules/codec/avcodec/d3d11va.c |    4 +---
 modules/codec/avcodec/dxva2.c   |    4 +---
 modules/codec/avcodec/va.h      |    7 +++----
 modules/codec/avcodec/vaapi.c   |    3 +--
 modules/codec/avcodec/vda.c     |    6 ++----
 modules/codec/avcodec/video.c   |    8 +-------
 modules/hw/vdpau/avcodec.c      |    4 +---
 7 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 7cda195..c3c4492 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -144,13 +144,11 @@ static void SetupAVCodecContext(vlc_va_t *);
 static picture_t *DxAllocPicture(vlc_va_t *, const video_format_t *, unsigned index);
 
 /* */
-static int Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
+static void Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
 {
     vlc_va_sys_t *sys = va->sys;
 
     *chroma = sys->filter == NULL ? VLC_CODEC_D3D11_OPAQUE : VLC_CODEC_YV12;
-
-    return VLC_SUCCESS;
 }
 
 void SetupAVCodecContext(vlc_va_t *va)
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index b626fd4..643c000 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -204,13 +204,11 @@ static filter_t *CreateFilter( vlc_object_t *p_this, const es_format_t *p_fmt_in
 }
 
 /* */
-static int Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
+static void Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
 {
     vlc_va_sys_t *sys = va->sys;
 
     *chroma = sys->filter == NULL ? VLC_CODEC_D3D9_OPAQUE : VLC_CODEC_YV12;
-
-    return VLC_SUCCESS;
 }
 
 void SetupAVCodecContext(vlc_va_t *va)
diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h
index e08a39b..5dc8b0a 100644
--- a/modules/codec/avcodec/va.h
+++ b/modules/codec/avcodec/va.h
@@ -36,7 +36,7 @@ struct vlc_va_t {
     module_t *module;
     const char *description;
 
-    int  (*setup)(vlc_va_t *, vlc_fourcc_t *output);
+    void (*setup)(vlc_va_t *, vlc_fourcc_t *output);
     int  (*get)(vlc_va_t *, picture_t *pic, uint8_t **data);
     void (*release)(void *pic, uint8_t *surface);
     int  (*extract)(vlc_va_t *, picture_t *pic, uint8_t *data);
@@ -64,11 +64,10 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *,
 /**
  * Initializes the acceleration video decoding back-end for libavcodec.
  * @param output pointer to video chroma output by the back-end [OUT]
- * @return VLC_SUCCESS on success, otherwise an error code.
  */
-static inline int vlc_va_Setup(vlc_va_t *va, vlc_fourcc_t *output)
+static inline void vlc_va_Setup(vlc_va_t *va, vlc_fourcc_t *output)
 {
-    return va->setup(va, avctx, output);
+    va->setup(va, output);
 }
 
 /**
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index fa04a66..24ddda4 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -187,10 +187,9 @@ static void Release( void *opaque, uint8_t *data )
     (void) data;
 }
 
-static int Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
+static void Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
 {
     *pi_chroma = VLC_CODEC_YV12;
-    return VLC_SUCCESS;
 }
 
 static void Delete( vlc_va_t *va, AVCodecContext *avctx )
diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c
index 2425844..979b882 100644
--- a/modules/codec/avcodec/vda.c
+++ b/modules/codec/avcodec/vda.c
@@ -48,7 +48,7 @@
 static int Open( vlc_va_t *, AVCodecContext *, enum PixelFormat,
                  const es_format_t *, picture_sys_t * );
 static void Close( vlc_va_t * , AVCodecContext *);
-static int Setup( vlc_va_t *, vlc_fourcc_t *);
+static void Setup( vlc_va_t *, vlc_fourcc_t *);
 static int Get( vlc_va_t *, picture_t *, uint8_t ** );
 static int Extract( vlc_va_t *, picture_t *, uint8_t * );
 static void Release( void *opaque, uint8_t *data );
@@ -174,11 +174,9 @@ static void Close( vlc_va_t *va, AVCodecContext *avctx )
     (void) va;
 }
 
-static int Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
+static void Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
 {
     *pi_chroma = VLC_CODEC_I420;
-
-    return VLC_SUCCESS;
 }
 
 // Never called
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index e3638e6..4f6a0e2 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1134,13 +1134,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
         if (va == NULL)
             continue; /* Unsupported codec profile or such */
 
-        if (vlc_va_Setup(va, &p_dec->fmt_out.video.i_chroma))
-        {
-            msg_Err( p_dec, "acceleration setup failure" );
-            vlc_va_Delete(va, p_context);
-            continue;
-        }
-
+        vlc_va_Setup(va, &p_dec->fmt_out.video.i_chroma);
         post_mt(p_sys);
 
         if (va->description != NULL)
diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 06e7209..0db483f 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -140,7 +140,7 @@ static int Copy(vlc_va_t *va, picture_t *pic, uint8_t *data)
     return VLC_SUCCESS;
 }
 
-static int Setup(vlc_va_t *va, vlc_fourcc_t *chromap)
+static void Setup(vlc_va_t *va, vlc_fourcc_t *chromap)
 {
     vlc_va_sys_t *sys = va->sys;
 
@@ -158,8 +158,6 @@ static int Setup(vlc_va_t *va, vlc_fourcc_t *chromap)
         default:
             vlc_assert_unreachable();
     }
-
-    return VLC_SUCCESS;
 }
 
 static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,



More information about the vlc-commits mailing list