[vlc-devel] [PATCH 07/12] vlc_player: handle input's angle event

Francois Cartegnie fcvlcdev at free.fr
Thu Apr 2 20:40:15 CEST 2020


---
 src/player/input.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/player/input.c b/src/player/input.c
index 093a8fcc99..e43b316988 100644
--- a/src/player/input.c
+++ b/src/player/input.c
@@ -568,6 +568,21 @@ vlc_player_input_HandleChapterEvent(struct vlc_player_input *input,
                          chapter, ev->seekpoint);
 }
 
+static void
+vlc_player_input_HandleAngleEvent(struct vlc_player_input *input,
+                                  const struct vlc_input_event_angle *ev)
+{
+    vlc_player_t *player = input->player;
+    if (!input->titles)
+        return;
+
+    const struct vlc_player_title *title = &input->titles->array[input->title_selected];
+    if (ev->angle > title->additional_angles)
+        return;
+
+    vlc_player_SendEvent(player, on_angle_selection_changed, ev->angle);
+}
+
 static void
 vlc_player_input_HandleVoutEvent(struct vlc_player_input *input,
                                  const struct vlc_input_event_vout *ev)
@@ -730,6 +745,9 @@ input_thread_Events(input_thread_t *input_thread,
         case INPUT_EVENT_CHAPTER:
             vlc_player_input_HandleChapterEvent(input, &event->chapter);
             break;
+        case INPUT_EVENT_ANGLE:
+            vlc_player_input_HandleAngleEvent(input, &event->angle);
+            break;
         case INPUT_EVENT_RECORD:
             input->recording = event->record;
             vlc_player_SendEvent(player, on_recording_changed, input->recording);
-- 
2.25.1



More information about the vlc-devel mailing list