[vlc-commits] [Git][videolan/vlc][master] mmal/vout: return a VLC error in configure_display()

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Sep 24 09:00:38 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7df26860 by Steve Lhomme at 2024-09-24T08:40:13+00:00
mmal/vout: return a VLC error in configure_display()

We can return that directly.

- - - - -


1 changed file:

- modules/hw/mmal/vout.c


Changes:

=====================================
modules/hw/mmal/vout.c
=====================================
@@ -506,7 +506,7 @@ static int configure_display(vout_display_t *vd)
     if (status != MMAL_SUCCESS) {
         msg_Err(vd, "Failed to commit format for input port %s (status=%"PRIx32" %s)",
                         sys->input->name, status, mmal_status_to_string(status));
-        return -EINVAL;
+        return VLC_EINVAL;
     }
     place_dest(vd);
 
@@ -523,7 +523,7 @@ static int configure_display(vout_display_t *vd)
     if (status != MMAL_SUCCESS) {
         msg_Err(vd, "Failed to set display region (status=%"PRIx32" %s)",
                         status, mmal_status_to_string(status));
-        return -EINVAL;
+        return VLC_EINVAL;
     }
 
     sys->adjust_refresh_rate = var_InheritBool(vd, MMAL_ADJUST_REFRESHRATE_NAME);
@@ -533,7 +533,7 @@ static int configure_display(vout_display_t *vd)
         set_latency_target(vd, true);
     }
 
-    return 0;
+    return VLC_SUCCESS;
 }
 
 static void vd_display(vout_display_t *vd, picture_t *p_pic)
@@ -641,25 +641,19 @@ static int vd_reset_pictures(vout_display_t *vd, video_format_t *fmt)
 
 static int vd_control(vout_display_t *vd, int query)
 {
-    int ret = VLC_EGENERIC;
-
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         case VOUT_DISPLAY_CHANGE_SOURCE_PLACE:
-        {
-            if (configure_display(vd) >= 0)
-                ret = VLC_SUCCESS;
-            break;
-        }
+            return configure_display(vd);
 
         default:
             msg_Warn(vd, "Unknown control query %d", query);
             break;
     }
 
-    return ret;
+    return VLC_EGENERIC;
 }
 
 static int attach_subpics(vout_display_t * const vd, vout_display_sys_t * const sys,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df26860bbae7a6e2c41a3d8aacd0fff346e5123

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7df26860bbae7a6e2c41a3d8aacd0fff346e5123
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