gui: Check the return code from collection_check_library()
If the library isn't valid, then we shouldn't try to pick another track until the user fixes things. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
aad90782ba
commit
6358124ce8
10
gui/gst.cpp
10
gui/gst.cpp
|
@ -144,29 +144,33 @@ public:
|
|||
static GSTDriver *gst_driver;
|
||||
|
||||
|
||||
static void parse_gst_error(GstMessage *error)
|
||||
static int parse_gst_error(GstMessage *error)
|
||||
{
|
||||
GError *err;
|
||||
struct track *track = audio :: current_track();
|
||||
gchar *path;
|
||||
int ret = 0;
|
||||
|
||||
gst_message_parse_error(error, &err, NULL);
|
||||
|
||||
if (track) {
|
||||
path = track_path(track);
|
||||
g_print("Error playing file: %s\n", path);
|
||||
collection_check_library(track->tr_library);
|
||||
ret = collection_check_library(track->tr_library);
|
||||
g_free(path);
|
||||
}
|
||||
g_print("Error: %s\n", err->message);
|
||||
g_error_free(err);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean on_gst_message(GstBus *bus, GstMessage *message, gpointer data)
|
||||
{
|
||||
switch (GST_MESSAGE_TYPE(message)) {
|
||||
case GST_MESSAGE_ERROR:
|
||||
parse_gst_error(message);
|
||||
if (parse_gst_error(message) < 0)
|
||||
break;
|
||||
audio :: next();
|
||||
audio :: play();
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue