dfbvideosink: Rework escape handling

Detected by a fallthrough.

* Just use if/else for clarity
* Remove 2002 fart joke

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
This commit is contained in:
Edward Hervey 2025-01-06 10:28:20 +01:00 committed by GStreamer Marge Bot
parent 45df33196f
commit 3d62f5b57b

View File

@ -594,21 +594,18 @@ gst_dfbvideosink_event_thread (GstDfbVideoSink * dfbvideosink)
"event buffer"); "event buffer");
} else { /* Handle event */ } else { /* Handle event */
if (event.input.type == DIET_KEYPRESS) { if (event.input.type == DIET_KEYPRESS) {
switch (event.input.key_symbol) { if (event.input.key_symbol == DIKS_ESCAPE) {
case DIKS_ESCAPE: GST_ELEMENT_ERROR (dfbvideosink, RESOURCE, OPEN_WRITE,
{ ("Video output device is gone."),
GST_ELEMENT_ERROR (dfbvideosink, RESOURCE, OPEN_WRITE, ("We were running fullscreen and user "
("Video output device is gone."), "pressed the ESC key, stopping playback."));
("We were running fullscreen and user " } else {
"pressed the ESC key, stopping playback.")); GST_DEBUG_OBJECT (dfbvideosink, "key press event %c !",
} event.input.key_symbol);
default: gst_dfbvideosink_navigation_send_event
GST_DEBUG_OBJECT (dfbvideosink, "key press event %c !", (GST_NAVIGATION (dfbvideosink),
event.input.key_symbol); gst_navigation_event_new_key_press ("dfb",
gst_dfbvideosink_navigation_send_event GST_NAVIGATION_MODIFIER_NONE));
(GST_NAVIGATION (dfbvideosink),
gst_navigation_event_new_key_press ("prout",
GST_NAVIGATION_MODIFIER_NONE));
} }
} else if (event.input.type == DIET_BUTTONPRESS) { } else if (event.input.type == DIET_BUTTONPRESS) {
gint x, y; gint x, y;