[vlc-commits] avcodec:va_surface: simplify the setup flow

Steve Lhomme git at videolan.org
Tue Mar 20 10:49:18 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 20 10:14:24 2018 +0100| [5bf356e13007d9d1beb5b7f3d08dbe029ecaeac8] | committer: Hugo Beauzée-Luyssen

avcodec:va_surface: simplify the setup flow

(cherry picked from commit 23177c31517be0626240662b74aac4b33ed06a4b)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/codec/avcodec/va_surface.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index dcd512527f..60a00c7e99 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -95,12 +95,12 @@ int va_pool_SetupDecoder(vlc_va_t *va, va_pool_t *va_pool, const AVCodecContext
     fmt.i_frame_rate      = avctx->framerate.num;
     fmt.i_frame_rate_base = avctx->framerate.den;
 
-    if (va_pool->pf_create_decoder_surfaces(va, avctx->codec_id, &fmt, count))
-        return VLC_EGENERIC;
-
-    va_pool->surface_width  = surface_width;
-    va_pool->surface_height = surface_height;
-    err = VLC_SUCCESS;
+    err = va_pool->pf_create_decoder_surfaces(va, avctx->codec_id, &fmt, count);
+    if (err == VLC_SUCCESS)
+    {
+        va_pool->surface_width  = surface_width;
+        va_pool->surface_height = surface_height;
+    }
 
 done:
     va_pool->surface_count = i;



More information about the vlc-commits mailing list