[vlc-commits] [Git][videolan/vlc][master] 4 commits: placebo: display: fix typo

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Aug 24 09:03:15 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0fbaf6c2 by Alexandre Janniaux at 2022-08-24T08:51:46+00:00
placebo: display: fix typo

- - - - -
e434d9a4 by Alexandre Janniaux at 2022-08-24T08:51:46+00:00
placebo: display: reset vd->sys in case of error

- - - - -
f2dfd4b2 by Alexandre Janniaux at 2022-08-24T08:51:46+00:00
libplacebo: instance: remove write-only module

pl->module is only used to check whether a module has been loaded and is
not even used for release afterwards.

- - - - -
9e19c47f by Alexandre Janniaux at 2022-08-24T08:51:46+00:00
libplacebo: instance: handle log creation error

- - - - -


3 changed files:

- modules/video_output/libplacebo/display.c
- modules/video_output/libplacebo/instance.c
- modules/video_output/libplacebo/instance.h


Changes:

=====================================
modules/video_output/libplacebo/display.c
=====================================
@@ -99,7 +99,7 @@ static const struct vlc_display_operations ops = {
 static int Open(vout_display_t *vd,
                 video_format_t *fmt, vlc_video_context *context)
 {
-    vout_display_sys_t *sys = vd->sys =
+    vout_display_sys_t *sys =
         vlc_obj_calloc(VLC_OBJECT(vd), 1, sizeof (*sys));
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;
@@ -110,10 +110,13 @@ static int Open(vout_display_t *vd,
     if (sys->pl == NULL)
         return VLC_EGENERIC;
 
+    /* From now on, the error label will reset this to NULL. */
+    vd->sys = sys;
+
     if (vlc_placebo_MakeCurrent(sys->pl) != VLC_SUCCESS)
         goto error;
 
-    // Set colorsapce hint *before* first swapchain resize
+    // Set colorspace hint *before* first swapchain resize
     UpdateColorspaceHint(vd, fmt);
 
     // Set initial framebuffer size
@@ -176,6 +179,7 @@ static int Open(vout_display_t *vd,
 error:
     pl_renderer_destroy(&sys->renderer);
     vlc_placebo_Release(sys->pl);
+    vd->sys = NULL;
     return VLC_EGENERIC;
 }
 


=====================================
modules/video_output/libplacebo/instance.c
=====================================
@@ -57,18 +57,25 @@ vlc_placebo_t *vlc_placebo_Create(const vout_display_cfg_t *cfg, const char *nam
     pl->sys = NULL;
     pl->ops = NULL;
     pl->log = vlc_placebo_CreateLog(VLC_OBJECT(pl));
-    pl->module = vlc_module_load(parent, "libplacebo gpu", name, false,
-                                 vlc_placebo_start, pl, cfg);
+    if (pl->log == NULL)
+        goto delete_pl;
 
-    if (pl->module == NULL)
-    {
-        vlc_object_delete(pl);
-        return NULL;
-    }
+    module_t *module = vlc_module_load(parent, "libplacebo gpu", name, false,
+                                       vlc_placebo_start, pl, cfg);
+    if (module == NULL)
+        goto delete_log;
 
     return pl;
+
+delete_log:
+    pl_log_destroy(&pl->log);
+
+delete_pl:
+    vlc_object_delete(pl);
+    return NULL;
 }
 
+
 void vlc_placebo_Release(vlc_placebo_t *pl)
 {
     if (pl->ops)


=====================================
modules/video_output/libplacebo/instance.h
=====================================
@@ -45,7 +45,6 @@ typedef struct vlc_placebo_t
 {
     // fields internal to instance.c, should not be touched
     struct vlc_object_t obj;
-    module_t *module;
     vlc_placebo_system_t *sys;
 
     pl_log log;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1cc04dc41b047042fd5375e8313131176c85a2ff...9e19c47f9e777edb2fad3e0da7de570ac62d9752

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1cc04dc41b047042fd5375e8313131176c85a2ff...9e19c47f9e777edb2fad3e0da7de570ac62d9752
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list