changeset 19461:0d191b783ed1

Fix audio stream selection in Gtk GUI Patch by Rich % rincebrain A gmail P com % Original Thred: Date: Aug 19, 2006 11:33 AM Subject: [MPlayer-dev-eng] [PATCH] Fix audio stream selection in Gtk GUI
author gpoirier
date Sun, 20 Aug 2006 18:52:55 +0000
parents 4553637b709b
children 08fc089138f4
files Gui/mplayer/gtk/menu.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/menu.c	Sun Aug 20 11:50:29 2006 +0000
+++ b/Gui/mplayer/gtk/menu.c	Sun Aug 20 18:52:55 2006 +0000
@@ -546,13 +546,20 @@
     
     if ( c > 1 )
      {
+      int basedec = 0;
+      int setdec = 0;
       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] )
         {
          char tmp[32];
-         snprintf( tmp,32,MSGTR_MENU_Track,i );
-         AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( i << 16 ) + evSetAudio );
+         if (!(setdec) )
+           {
+           basedec = (i > 1 ? i : 1);
+           setdec = 1;
+           }
+         snprintf( tmp,32,MSGTR_MENU_Track,(i-(basedec-1)) );
+         AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( (i-basedec) << 16 ) + evSetAudio );
         }
      }