[totem] Bug 581443 - Detect non-xine channels configuration



commit d28b9ac2f7475e8f1651f7d55795e97e164c9f39
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 7 11:35:57 2009 +0100

    Bug 581443 -  Detect non-xine channels configuration
    
    Detect that the channels.conf file isn't in the format we
    expect and error out

 src/backend/bacon-video-widget-gst-0.10.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index d1555ca..b5a19ff 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -4909,6 +4909,10 @@ bacon_video_widget_get_dvb_mrls (const char *device)
 	    (g_strv_length (fields) == 9 && adapter_type == 'C') ||
 	    (g_strv_length (fields) == 6 && adapter_type == 'A')) {
 	  g_ptr_array_add (array, g_strdup_printf("dvb://%s", fields[0]));
+	} else {
+	  /* Exit if the channels.conf is in a format we don't understand */
+	  g_ptr_array_free (array, TRUE);
+	  return (char **) NULL;
 	}
 	g_strfreev(fields);
       }
@@ -5025,6 +5029,13 @@ bacon_video_widget_get_mrls (BaconVideoWidget * bvw,
       if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
 	g_free (filename);
         mrls = bacon_video_widget_get_dvb_mrls (device);
+	if (mrls == NULL) {
+	  GST_DEBUG ("broken channels file '%s'", filename);
+	  g_set_error_literal (error, BVW_ERROR, BVW_ERROR_FILE_NOT_FOUND,
+			       "XXX Do not use XXX");
+	  g_free (filename);
+	  return NULL;
+	}
       } else {
         GST_DEBUG ("no channels file '%s'", filename);
 	g_set_error_literal (error, BVW_ERROR, BVW_ERROR_FILE_NOT_FOUND,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]