[MPlayer-cvslog] CVS: main/libmpdemux tv.c,1.73,1.74

Aurelien Jacobs CVS syncmail at mplayerhq.hu
Tue Sep 13 00:48:16 CEST 2005


CVS change done by Aurelien Jacobs CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv8360/libmpdemux

Modified Files:
	tv.c 
Log Message:
cycle through tv channels (patch by Andrew Calkin < calkina at geexbox.org >)

Index: tv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- tv.c	5 Aug 2005 19:57:47 -0000	1.73
+++ tv.c	12 Sep 2005 22:48:14 -0000	1.74
@@ -738,22 +738,25 @@
 int tv_step_channel(tvi_handle_t *tvh, int direction) {
 	if (tv_channel_list) {
 		if (direction == TV_CHANNEL_HIGHER) {
-			if (tv_channel_current->next) {
-				tv_channel_last = tv_channel_current;
+			tv_channel_last = tv_channel_current;
+			if (tv_channel_current->next)
 				tv_channel_current = tv_channel_current->next;
+			else
+				tv_channel_current = tv_channel_list;
 				tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 				mp_msg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n",
 			tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
-			}
 		}
 		if (direction == TV_CHANNEL_LOWER) {
-			if (tv_channel_current->prev) {
-				tv_channel_last = tv_channel_current;
+			tv_channel_last = tv_channel_current;
+			if (tv_channel_current->prev)
 				tv_channel_current = tv_channel_current->prev;
+			else
+				while (tv_channel_current->next)
+					tv_channel_current = tv_channel_current->next;
 				tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 				mp_msg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n",
 			tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
-			}
 		}
 	} else tv_step_channel_real(tvh, direction);
 	return(1);




More information about the MPlayer-cvslog mailing list