[mplayer-dev-eng] goto next audio stream & goto next video stream & alles wird gut patch

Rüdiger Kuhlmann mplayer-list-UGa6JdjLujS2 at ruediger-kuhlmann.de
Wed Dec 11 20:51:46 CET 2002


>--[Rüdiger Kuhlmann]--<mplayer-list-UGa6JdjLujS2 at ruediger-kuhlmann.de>

> here's a new version of my patch to implement an event that loads the next
> audio resp. video stream from the current movie file. It also includes all
> patches that till now have been ignored.

Seems a few of my patch hunks have been applied. Anyway, since the internal
workings of mplayer have changed again, here's a new version of the patch:

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.625
diff -u -r1.625 mplayer.c
--- mplayer.c	11 Dec 2002 01:20:53 -0000	1.625
+++ mplayer.c	11 Dec 2002 20:21:27 -0000
@@ -201,6 +201,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;
 static char* audio_lang=NULL;
@@ -1025,6 +1027,11 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
   exit_player(MSGTR_Exit_eof);
 }
+
+if (gui_audio_id != -1)
+    audio_id = gui_audio_id;
+if (gui_video_id != -1)
+    video_id = gui_video_id;
 
 #ifdef USE_DVDREAD
 if(stream->type==STREAMTYPE_DVD){
Index: mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.h,v
retrieving revision 1.24
diff -u -r1.24 mplayer.h
--- mplayer.h	11 Dec 2002 01:20:53 -0000	1.24
+++ mplayer.h	11 Dec 2002 20:21:27 -0000
@@ -48,8 +48,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.18
diff -u -r1.18 app.c
--- Gui/app.c	29 Nov 2002 00:58:22 -0000	1.18
+++ Gui/app.c	11 Dec 2002 20:21:27 -0000
@@ -63,7 +63,9 @@
   { evLoadAudioFile,	 "evLoadAudioFile"     },
   { evDropSubtitle,      "evDropSubtitle"      },
   { evSetAspect,	 "evSetAspect"	       },
-  { evSetAudio,		 "evSetAudio"	       }
+  { 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.15
diff -u -r1.15 app.h
--- Gui/app.h	11 Dec 2002 01:21:08 -0000	1.15
+++ Gui/app.h	11 Dec 2002 20:21:27 -0000
@@ -61,6 +61,9 @@
 #define evSetVideo	    46
 // 47 ...
 
+#define evAudioNext         99
+#define evVideoNext        100
+
 #define evExit              1000
 
 // --- General events ---
Index: Gui/mplayer/mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.97
diff -u -r1.97 mw.c
--- Gui/mplayer/mw.c	11 Dec 2002 01:21:09 -0000	1.97
+++ Gui/mplayer/mw.c	11 Dec 2002 20:21:28 -0000
@@ -121,11 +121,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;
@@ -188,7 +191,7 @@
 {
  wItem    * item;
  txSample * image = NULL;
- int        i, type;
+ int        i;
 
  if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
  
@@ -270,16 +273,46 @@
         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;
+	audio_id = gui_audio_id = iparam;
 	guiIntfStruct.NewPlay=1;
+	guiIntfStruct.FilenameChanged=1;
 	break;
 
+   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;
-	guiIntfStruct.NewPlay=1;
+	video_id = gui_video_id = iparam;
+	guiIntfStruct.NewPlay = 1;
+	guiIntfStruct.FilenameChanged=1;
 	break;
 
 #ifdef HAVE_VCD
Index: libmpdemux/demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.124
diff -u -r1.124 demuxer.c
--- libmpdemux/demuxer.c	7 Dec 2002 01:07:11 -0000	1.124
+++ libmpdemux/demuxer.c	11 Dec 2002 20:21:29 -0000
@@ -1257,6 +1257,8 @@
 	case DEMUXER_TYPE_ASF:
 	    return demux_asf_control(demuxer,cmd,arg);
 	case DEMUXER_TYPE_AVI:
+	case DEMUXER_TYPE_AVI_NI:
+	case DEMUXER_TYPE_AVI_NINI:
 	    return demux_avi_control(demuxer,cmd,arg);
 
 	default:

Anyway, the following is still true:

> Also, I made a screenshot of my KDE theme:
> 
> http://www.stud.uni-karlsruhe.de/~uck4/Krams/KDE_screenshot.png
> http://www.stud.uni-karlsruhe.de/~uck4/Krams/KDE.tgz
> 
> Did I already mention that I'd like to have it in the list of skins as well?

-- 
         100 DM =  51  € 13 ¢.
         100  € = 195 DM 58 pf.
  mailto:ruediger at ruediger-kuhlmann.de
    http://www.ruediger-kuhlmann.de/



More information about the MPlayer-dev-eng mailing list