From 82f84416a9d3f2d983e9207cebcae9e11b50b6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 23 Sep 2015 20:43:42 +0200 Subject: [PATCH] recorder: Rewrite switch statement Avoid compiler warnings about unhandled enum values by using a regular if-else statement. --- src/shell-recorder.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/shell-recorder.c b/src/shell-recorder.c index b28e1e91e..e6d43778f 100644 --- a/src/shell-recorder.c +++ b/src/shell-recorder.c @@ -1182,23 +1182,20 @@ recorder_pipeline_bus_watch (GstBus *bus, { RecorderPipeline *pipeline = data; - switch (message->type) + if (message->type == GST_MESSAGE_EOS) { - case GST_MESSAGE_EOS: recorder_pipeline_closed (pipeline); return FALSE; /* remove watch */ - case GST_MESSAGE_ERROR: - { - GError *error; + } + else if (message->type == GST_MESSAGE_ERROR) + { + GError *error; - gst_message_parse_error (message, &error, NULL); - g_warning ("Error in recording pipeline: %s\n", error->message); - g_error_free (error); - recorder_pipeline_closed (pipeline); - return FALSE; /* remove watch */ - } - default: - break; + gst_message_parse_error (message, &error, NULL); + g_warning ("Error in recording pipeline: %s\n", error->message); + g_error_free (error); + recorder_pipeline_closed (pipeline); + return FALSE; /* remove watch */ } /* Leave the watch in place */