changeset 25356:a5c22f3e4673

cosmetics: partially reformatted this monstruosity
author nicodvb
date Wed, 12 Dec 2007 23:01:49 +0000
parents 3110688d2406
children b265c001e64a
files libmenu/menu_dvbin.c
diffstat 1 files changed, 31 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/libmenu/menu_dvbin.c	Wed Dec 12 22:54:20 2007 +0000
+++ b/libmenu/menu_dvbin.c	Wed Dec 12 23:01:49 2007 +0000
@@ -83,8 +83,8 @@
 
 	mpriv->level = 2;
 	if(dvb_list_ptr == NULL)
-    {
-    	mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_set_channel: LIST NULL PTR, quit\n");
+	{
+		mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_set_channel: LIST NULL PTR, quit\n");
 		n = 1;
 		if((elem = calloc(1, sizeof(list_entry_t))) != NULL)
 		{
@@ -94,10 +94,10 @@
 			menu_list_add_entry(menu, elem);
 		}
 		return 1;
-    }
-		for(n = 0; n < dvb_list_ptr->NUM_CHANNELS; n++)
-		{
-			channel = &(dvb_list_ptr->channels[n]);
+	}
+	for(n = 0; n < dvb_list_ptr->NUM_CHANNELS; n++)
+	{
+		channel = &(dvb_list_ptr->channels[n]);
 		if((elem = calloc(1, sizeof(list_entry_t))) != NULL)
 		{
 			elem->p.next 	= NULL;
@@ -110,7 +110,6 @@
 		{
 			mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", 
 					sizeof(list_entry_t), strerror(errno));
-		
 			break;
 		}
 	}  
@@ -127,27 +126,26 @@
 	for(n = 0; n < conf->count; n++)
 	{
 		if((elem = calloc(1, sizeof(list_entry_t))) != NULL)
-			{
-				elem->p.next 	= NULL;
+		{
+			elem->p.next 	= NULL;
 			elem->p.txt	= strdup(conf->cards[n].name);
-				elem->num 	= n;
+			elem->num 	= n;
 				
-				if(n == 0)
-				    elem->p.prev = NULL;
+			if(n == 0)
+			    elem->p.prev = NULL;
 				
-				menu_list_add_entry(menu, elem);
-			}
-			else
-			{
+			menu_list_add_entry(menu, elem);
+		}
+		else
+		{
 			fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", 
-						sizeof(list_entry_t), strerror(errno));
-			
-			  if(n)
+				sizeof(list_entry_t), strerror(errno));
+			if(n)
 				return 1;
-			
-			  return 0;
-			}
-		}  
+
+			return 0;
+		}
+	}  
 	
 	return n;
 }
@@ -168,7 +166,7 @@
 			elem->p.txt = strdup("NO DVB configuration present!");
 
 			menu_list_add_entry(menu, elem);
-	return 1;
+			return 1;
 		}
 		return 0;
 	}
@@ -212,15 +210,15 @@
 			else
 				sprintf(cmd_name, "loadfile 'dvb://%d@%s'", mpriv->card+1, elem->p.txt);
 		
-		c = mp_input_parse_cmd(cmd_name);
-		free(cmd_name);
-    	if(c)
-          {
-            if (mpriv->auto_close)
-              mp_input_queue_cmd (mp_input_parse_cmd ("menu hide"));
-            mp_input_queue_cmd(c);
-          }
-  	}
+			c = mp_input_parse_cmd(cmd_name);
+			free(cmd_name);
+			if(c)
+			{
+				if(mpriv->auto_close)
+					mp_input_queue_cmd (mp_input_parse_cmd ("menu hide"));
+				mp_input_queue_cmd(c);
+			}
+		}
   	}
   	break;