[MPlayer-dev-eng] Re: [PATCH] GUI: fix audio/video id in gtk/menu.c

Stanislav Maslovski stanislav.maslovski at gmail.com
Tue Apr 11 11:46:21 CEST 2006


On Tue, Apr 11, 2006 at 11:13:34AM +0200, Guillaume Poirier wrote:
> Hi,
> 
> Stanislav Maslovski wrote:
> > On Tue, Apr 11, 2006 at 12:36:54PM +0400, Stanislav Maslovski wrote:
> 
> >>When playing an ogg file in gmplayer I noticed that changing audio streams
> >>from the menu was buggy. An investigation showed that in gtk/menu.c the
> >>audio and video streams' IDs were assumed to be equal to the indexes of
> >>the corresponding demuxer->a_streams[i] and demuxer->v_streams[i] members.
> >>However, from reading demux_ogg.c and demux_mkv.c codes I see that those
> >>IDs are simply continuously counted from 0. Please, correct me if I am wrong
> >>or if there are other cases I have not noticed.
> > 
> > 
> > I mean the IDs that are used in -aid, for example.
> 
> Isn't precisely -aid a counter example? On DVDs, "aid" starts at 128,
> and on some dvb streams I've had on hand, it started at 130...

Well, as i said i have checked only mkv and ogg demuxers ;) So, there is no
standard for -aids and similar in mplayer?

The GUI code treats DVD case in a different manner: the part of the code the
patch affects is simply skipped for a DVD (see line 23710 of gtk/menu.c).

Where a dvb stream gets demuxed? I can add a special case for it.

Meanwhile, a better patch is ready ;) (for the case when ids are
continuously growing from zero, i.e. for ogg and matroska). Attached.

--
Stanislav
-------------- next part --------------
Index: Gui/mplayer/gtk/menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/menu.c,v
retrieving revision 1.36
diff -u -r1.36 menu.c
--- Gui/mplayer/gtk/menu.c	15 Dec 2005 20:39:59 -0000	1.36
+++ Gui/mplayer/gtk/menu.c	11 Apr 2006 09:21:18 -0000
@@ -545,8 +545,7 @@
     if ( c > 1 )
      {
       SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack );
-      for ( i=0;i < MAX_A_STREAMS;i++ )
-       if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] )
+      for ( i=0;i < c;i++ )
         {
          char tmp[32];
          snprintf( tmp,32,MSGTR_MENU_Track,i );
@@ -560,8 +559,7 @@
     if ( c > 1 )
      {
       SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack );
-      for ( i=0;i < MAX_V_STREAMS;i++ )
-       if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] )
+      for ( i=0;i < c;i++ )
         {
          char tmp[32];
          snprintf( tmp,32,MSGTR_MENU_Track,i );


More information about the MPlayer-dev-eng mailing list