[MPlayer-cvslog] r33745 - in trunk: gui/interface.c gui/interface.h gui/ui/gtk/menu.c gui/ui/main.c gui/win32/interface.c mplayer.c

ib subversion at mplayerhq.hu
Mon Jun 27 21:14:45 CEST 2011


Author: ib
Date: Mon Jun 27 21:14:45 2011
New Revision: 33745

Log:
Remove guiGetEvent type guiSetDemuxer.

Directly retrieve the information from the mpcontext.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/gtk/menu.c
   trunk/gui/ui/main.c
   trunk/gui/win32/interface.c
   trunk/mplayer.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/gui/interface.c	Mon Jun 27 21:14:45 2011	(r33745)
@@ -607,10 +607,6 @@ int guiGetEvent(int type, void *arg)
         guiInfo.mpcontext = arg;
         break;
 
-    case guiSetDemuxer:
-        guiInfo.demuxer = arg;
-        break;
-
     case guiSetAfilter:
         guiInfo.afilter = arg;
         break;
@@ -784,7 +780,6 @@ int guiGetEvent(int type, void *arg)
             force_fps = 0;
         }
 
-        guiInfo.demuxer  = NULL;
         guiInfo.sh_video = NULL;
         wsPostRedisplay(&guiApp.subWindow);
 

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/gui/interface.h	Mon Jun 27 21:14:45 2011	(r33745)
@@ -49,7 +49,6 @@ extern int use_gui;             // this 
 #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 @@ typedef struct {
     struct MPContext *mpcontext;
     void *sh_video;
     void *afilter;
-    void *demuxer;
     void *event_struct;
 
     int DiskChanged;

Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/gui/ui/gtk/menu.c	Mon Jun 27 21:14:45 2011	(r33745)
@@ -411,6 +411,7 @@ GtkWidget * create_PopUpMenu( void )
  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 @@ GtkWidget * create_PopUpMenu( void )
     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 @@ GtkWidget * create_PopUpMenu( void )
     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 @@ GtkWidget * create_PopUpMenu( void )
      }
 
     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 );

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/gui/ui/main.c	Mon Jun 27 21:14:45 2011	(r33745)
@@ -118,12 +118,12 @@ void uiEventHandling( int msg,float para
 	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;
 

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/gui/win32/interface.c	Mon Jun 27 21:14:45 2011	(r33745)
@@ -590,9 +590,6 @@ int guiGetEvent(int type, void *arg)
         case guiSetContext:
             guiInfo.mpcontext = arg;
             break;
-        case guiSetDemuxer:
-            guiInfo.demuxer = arg;
-            break;
         case guiSetValues:
         {
             guiInfo.sh_video = arg;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Mon Jun 27 20:55:18 2011	(r33744)
+++ trunk/mplayer.c	Mon Jun 27 21:14:45 2011	(r33745)
@@ -3679,7 +3679,6 @@ goto_enable_cache:
         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;
         }


More information about the MPlayer-cvslog mailing list