Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f7498f6b by Steve Lhomme at 2024-04-03T16:01:08+00:00
vout_subpictures: handle margin from the center alignment in subpicture regions

The margin is added, so to shift to the left/top the margin (i_x/i_y) should be 
negative.

- - - - -


1 changed file:

- src/video_output/vout_subpictures.c


Changes:

=====================================
src/video_output/vout_subpictures.c
=====================================
@@ -707,7 +707,7 @@ static void SpuRegionPlace(int *x, int *y,
             if (i_align & SUBPICTURE_ALIGN_BOTTOM)
                 *y = subpic->i_original_picture_height - 
region->fmt.i_visible_height - region->i_y;
             else
-                *y = subpic->i_original_picture_height / 2 - 
region->fmt.i_visible_height / 2;
+                *y = subpic->i_original_picture_height / 2 - 
region->fmt.i_visible_height / 2 + region->i_y;
         }
 
         if (i_align & SUBPICTURE_ALIGN_LEFT)
@@ -718,7 +718,7 @@ static void SpuRegionPlace(int *x, int *y,
             if (i_align & SUBPICTURE_ALIGN_RIGHT)
                 *x = subpic->i_original_picture_width - 
region->fmt.i_visible_width - region->i_x;
             else
-                *x = subpic->i_original_picture_width / 2 - 
region->fmt.i_visible_width / 2;
+                *x = subpic->i_original_picture_width / 2 - 
region->fmt.i_visible_width / 2 + region->i_x;
         }
     }
 }



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

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/f7498f6b19a43af10883fb5bc35d88a16f9b3bf2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to