Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.725
diff -u -r1.725 mplayer.c
--- mplayer.c	29 Aug 2003 21:41:03 -0000	1.725
+++ mplayer.c	11 Sep 2003 01:44:21 -0000
@@ -237,6 +237,8 @@
 // streaming:
 int audio_id=-1;
 int video_id=-1;
+int gui_audio_id = -1;
+int gui_video_id = -1;
 int dvdsub_id=-1;
 int vobsub_id=-1;
 char* audio_lang=NULL;
Index: mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.h,v
retrieving revision 1.30
diff -u -r1.30 mplayer.h
--- mplayer.h	7 Apr 2003 16:03:37 -0000	1.30
+++ mplayer.h	11 Sep 2003 01:44:21 -0000
@@ -53,8 +53,8 @@
 
 extern int auto_quality;
 
-extern int audio_id;
-extern int video_id;
+extern int audio_id, gui_audio_id;
+extern int video_id, gui_video_id;
 extern int dvdsub_id;
 extern int vobsub_id;
 
Index: Gui/app.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/app.c,v
retrieving revision 1.23
diff -u -r1.23 app.c
--- Gui/app.c	20 Mar 2003 12:41:32 -0000	1.23
+++ Gui/app.c	11 Sep 2003 01:44:21 -0000
@@ -62,7 +62,10 @@
   { evSetURL,		 "evSetURL"	       },
   { evLoadAudioFile,	 "evLoadAudioFile"     },
   { evDropSubtitle,      "evDropSubtitle"      },
-  { evSetAspect,	 "evSetAspect"	       }
+  { evSetAspect,	 "evSetAspect"	       },
+  { evSetAudio,		 "evSetAudio"	       },
+  { evAudioNext, 	 "evAudioNext"	       },
+  { evVideoNext, 	 "evVideoNext"	       }
  };
 
 int evBoxs = sizeof( evNames ) / sizeof( evName );
Index: Gui/app.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/app.h,v
retrieving revision 1.18
diff -u -r1.18 app.h
--- Gui/app.h	20 Mar 2003 12:41:32 -0000	1.18
+++ Gui/app.h	11 Sep 2003 01:44:21 -0000
@@ -61,6 +61,9 @@
 #define evSetVideo	    46
 // 47 ...
 
+#define evAudioNext         99
+#define evVideoNext        100
+
 #define evExit              1000
 
 // --- General events ---
Index: Gui/mplayer/common.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/common.c,v
retrieving revision 1.3
diff -u -r1.3 common.c
--- Gui/mplayer/common.c	20 Mar 2003 12:42:09 -0000	1.3
+++ Gui/mplayer/common.c	11 Sep 2003 01:44:24 -0000
@@ -110,11 +110,14 @@
        case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
        case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
        case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
+       case 'A': if (audio_id == -1) sprintf (tmp, "a"); else sprintf (tmp, "%d", audio_id); strcat (trbuf, tmp); break;
+       case 'W': if (video_id == -1) sprintf (tmp, "a"); else sprintf (tmp, "%d", video_id); strcat (trbuf, tmp); break;
        case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
        case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
        case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break;
        case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break;
-       case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
+       case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video && ((sh_video_t *)guiIntfStruct.sh_video)->codec
+                         ? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
                  strcat( trbuf,tmp ); break;
        case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
        case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
Index: Gui/mplayer/mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.110
diff -u -r1.110 mw.c
--- Gui/mplayer/mw.c	26 May 2003 08:45:42 -0000	1.110
+++ Gui/mplayer/mw.c	11 Sep 2003 01:44:24 -0000
@@ -50,7 +50,7 @@
 {
  wItem    * item;
  txSample * image = NULL;
- int        i, type;
+ int        i;
 
  if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
  
@@ -96,11 +96,39 @@
         gtkShow( evPlayNetwork,NULL );
 	break;
 
+   case evAudioNext:
+        if (!guiIntfStruct.demuxer) break;
+        if (gui_audio_id == -1)
+        {
+          for (gui_audio_id = 0; gui_audio_id < MAX_A_STREAMS; gui_audio_id++)
+            if (((demuxer_t *)guiIntfStruct.demuxer)->a_streams[gui_audio_id])
+              break;
+          gui_audio_id %= MAX_A_STREAMS;
+        }
+        for (j = gui_audio_id + 1; j < gui_audio_id + MAX_A_STREAMS; j++)
+          if (((demuxer_t *)guiIntfStruct.demuxer)->a_streams[j % MAX_A_STREAMS])
+            break;
+        iparam = j % MAX_A_STREAMS;
+        /* fall-through */
    case evSetAudio:
         if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
 	audio_id=iparam;
 	goto play;
 
+   case evVideoNext:
+        if (!guiIntfStruct.demuxer) break;
+        if (gui_video_id == -1)
+        {
+          for (gui_video_id = 0; gui_video_id < MAX_A_STREAMS; gui_video_id++)
+            if (((demuxer_t *)guiIntfStruct.demuxer)->v_streams[gui_video_id])
+              break;
+          gui_video_id %= MAX_A_STREAMS;
+        }
+        for (j = gui_video_id + 1; j < gui_video_id + MAX_A_STREAMS; j++)
+          if (((demuxer_t *)guiIntfStruct.demuxer)->v_streams[j % MAX_A_STREAMS])
+            break;
+        iparam = j % MAX_A_STREAMS;
+        /* fall-through */
    case evSetVideo:
         if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
 	video_id=iparam;
