changeset 33657:c92f23eac7a4

Remove guiGetEvent type guiSetDemuxer. Directly retrieve the information from the mpcontext.
author ib
date Mon, 27 Jun 2011 19:14:45 +0000
parents 3c300c37766f
children 3a617d41751a
files gui/interface.c gui/interface.h gui/ui/gtk/menu.c gui/ui/main.c gui/win32/interface.c mplayer.c
diffstat 6 files changed, 11 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Mon Jun 27 18:55:18 2011 +0000
+++ b/gui/interface.c	Mon Jun 27 19:14:45 2011 +0000
@@ -607,10 +607,6 @@
         guiInfo.mpcontext = arg;
         break;
 
-    case guiSetDemuxer:
-        guiInfo.demuxer = arg;
-        break;
-
     case guiSetAfilter:
         guiInfo.afilter = arg;
         break;
@@ -784,7 +780,6 @@
             force_fps = 0;
         }
 
-        guiInfo.demuxer  = NULL;
         guiInfo.sh_video = NULL;
         wsPostRedisplay(&guiApp.subWindow);
 
--- a/gui/interface.h	Mon Jun 27 18:55:18 2011 +0000
+++ b/gui/interface.h	Mon Jun 27 19:14:45 2011 +0000
@@ -49,7 +49,6 @@
 #define guiSetVolume       11
 #define guiSetDefaults     12
 #define guiSetValues       13
-#define guiSetDemuxer      15
 #define guiSetParameters   16
 #define guiSetAfilter      17
 #define guiSetContext      18
@@ -149,7 +148,6 @@
     struct MPContext *mpcontext;
     void *sh_video;
     void *afilter;
-    void *demuxer;
     void *event_struct;
 
     int DiskChanged;
--- a/gui/ui/gtk/menu.c	Mon Jun 27 18:55:18 2011 +0000
+++ b/gui/ui/gtk/menu.c	Mon Jun 27 19:14:45 2011 +0000
@@ -411,6 +411,7 @@
  GtkWidget * SubMenu = NULL;
  GtkWidget * MenuItem = NULL;
  GtkWidget * H, * N, * D, * F;
+ demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext);
  mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext);
  int global_sub_size = mpctx_get_global_sub_size(guiInfo.mpcontext);
 
@@ -510,7 +511,7 @@
     DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audiolang_xpm, DVDSubMenu,MSGTR_MENU_AudioLanguages );
      if ( guiInfo.DVD.nr_of_audio_channels )
       {
-       char tmp[64]; int i, id = guiInfo.demuxer ? ((demuxer_t *)guiInfo.demuxer)->audio->id : audio_id;
+       char tmp[64]; int i, id = demuxer ? demuxer->audio->id : audio_id;
        for ( i=0;i < guiInfo.DVD.nr_of_audio_channels;i++ )
         {
 	 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.DVD.audio_streams[i].language ),
@@ -556,20 +557,20 @@
     AddMenuItem( window1, (const char*)aspect235_xpm, AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
    }
 
-  if ( guiInfo.Playing && guiInfo.demuxer && guiInfo.StreamType != STREAMTYPE_DVD )
+  if ( guiInfo.Playing && demuxer && guiInfo.StreamType != STREAMTYPE_DVD )
    {
     int i,c = 0;
 
     for ( i=0;i < MAX_A_STREAMS;i++ )
-     if ( ((demuxer_t *)guiInfo.demuxer)->a_streams[i] ) c++;
+     if ( demuxer->a_streams[i] ) c++;
 
     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 *)guiInfo.demuxer)->a_streams[i] )
+       if ( demuxer->a_streams[i] )
         {
-         int aid = ((sh_audio_t *)((demuxer_t *)guiInfo.demuxer)->a_streams[i])->aid;
+         int aid = ((sh_audio_t *)demuxer->a_streams[i])->aid;
          char tmp[32];
          snprintf( tmp,32,MSGTR_MENU_Track,aid );
          AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( aid << 16 ) + evSetAudio );
@@ -577,15 +578,15 @@
      }
 
     for ( c=0,i=0;i < MAX_V_STREAMS;i++ )
-     if ( ((demuxer_t *)guiInfo.demuxer)->v_streams[i] ) c++;
+     if ( demuxer->v_streams[i] ) c++;
 
     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 *)guiInfo.demuxer)->v_streams[i] )
+       if ( demuxer->v_streams[i] )
         {
-         int vid = ((sh_video_t *)((demuxer_t *)guiInfo.demuxer)->v_streams[i])->vid;
+         int vid = ((sh_video_t *)demuxer->v_streams[i])->vid;
          char tmp[32];
          snprintf( tmp,32,MSGTR_MENU_Track,vid );
          AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( vid << 16 ) + evSetVideo );
--- a/gui/ui/main.c	Mon Jun 27 18:55:18 2011 +0000
+++ b/gui/ui/main.c	Mon Jun 27 19:14:45 2011 +0000
@@ -118,12 +118,12 @@
 	break;
 
    case evSetAudio:
-        if ( !guiInfo.demuxer || audio_id == iparam ) break;
+        if ( !mpctx_get_demuxer(guiInfo.mpcontext) || audio_id == iparam ) break;
 	audio_id=iparam;
 	goto play;
 
    case evSetVideo:
-        if ( !guiInfo.demuxer || video_id == iparam ) break;
+        if ( !mpctx_get_demuxer(guiInfo.mpcontext) || video_id == iparam ) break;
 	video_id=iparam;
 	goto play;
 
--- a/gui/win32/interface.c	Mon Jun 27 18:55:18 2011 +0000
+++ b/gui/win32/interface.c	Mon Jun 27 19:14:45 2011 +0000
@@ -590,9 +590,6 @@
         case guiSetContext:
             guiInfo.mpcontext = arg;
             break;
-        case guiSetDemuxer:
-            guiInfo.demuxer = arg;
-            break;
         case guiSetValues:
         {
             guiInfo.sh_video = arg;
--- a/mplayer.c	Mon Jun 27 18:55:18 2011 +0000
+++ b/mplayer.c	Mon Jun 27 19:14:45 2011 +0000
@@ -3679,7 +3679,6 @@
         if (use_gui) {
             guiInfo.AudioChannels = mpctx->sh_audio ? mpctx->sh_audio->channels : 0;
             guiGetEvent(guiSetAudioOnly, (void *)(mpctx->sh_audio && !mpctx->sh_video));
-            guiGetEvent(guiSetDemuxer, mpctx->demuxer);
             if (guiGetEvent(guiSetValues, mpctx->sh_video))
                 goto goto_next_file;
         }