[Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.52,1.53 play.c,1.52,1.53

Zoltan Ponekker pontscho at mplayerhq.hu
Wed Apr 17 23:12:14 CEST 2002


Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var/tmp.root/cvs-serv27376/Gui/mplayer

Modified Files:
	mw.h play.c 
Log Message:
fix dvd playing under gui

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- mw.h	16 Apr 2002 17:41:29 -0000	1.52
+++ mw.h	17 Apr 2002 21:12:11 -0000	1.53
@@ -200,6 +200,7 @@
 extern void exit_player(char* how);
 extern int audio_id;
 extern int dvdsub_id;
+extern char * dvd_device;
 
 void mplEventHandling( int msg,float param )
 {
@@ -214,16 +215,16 @@
 
 #ifdef USE_DVDREAD
    case evPlayDVD:
-        dvd_title=1;
-        dvd_chapter=1;
-        dvd_angle=1;
+        guiIntfStruct.DVD.current_title=1;
+        guiIntfStruct.DVD.current_chapter=1;
+        guiIntfStruct.DVD.current_angle=1;
 play_dvd_2:
         guiIntfStruct.StreamType=STREAMTYPE_DVD;
 #endif
    case evPlay:
    case evPlaySwitchToPause:
         mplMainAutoPlay=0;
-        if ( ( msg == evPlaySwitchToPause )&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
+        if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
 
         switch ( guiIntfStruct.StreamType )
          {
@@ -234,7 +235,12 @@
                break;
 #ifdef USE_DVDREAD
           case STREAMTYPE_DVD:
-               guiSetFilename( guiIntfStruct.Filename,"/dev/dvd" );
+	       if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE;
+               guiSetFilename( guiIntfStruct.Filename,dvd_device );
+	       dvd_title=guiIntfStruct.DVD.current_title;
+	       dvd_angle=guiIntfStruct.DVD.current_angle;
+               dvd_chapter=guiIntfStruct.DVD.current_chapter;
+               guiIntfStruct.DVDChanged=1;
                break;
 #endif
          }
@@ -244,32 +250,20 @@
 #ifdef USE_DVDREAD
    case evSetDVDSubtitle:
         dvdsub_id=(int)param;
-        dvd_title=guiIntfStruct.DVD.current_title;
-        dvd_angle=guiIntfStruct.DVD.current_angle;
-        dvd_chapter=guiIntfStruct.DVD.current_chapter;
-        guiIntfStruct.DVDChanged=1;
         goto play_dvd_2;
         break;
    case evSetDVDAudio:
         audio_id=(int)param;
-        dvd_title=guiIntfStruct.DVD.current_title;
-        dvd_angle=guiIntfStruct.DVD.current_angle;
-        dvd_chapter=guiIntfStruct.DVD.current_chapter;
-        guiIntfStruct.DVDChanged=1;
         goto play_dvd_2;
         break;
    case evSetDVDChapter:
-        dvd_title=guiIntfStruct.DVD.current_title;
-        dvd_angle=guiIntfStruct.DVD.current_angle;
-        dvd_chapter=(int)param;
-        guiIntfStruct.DVDChanged=1;
+        guiIntfStruct.DVD.current_chapter=(int)param;
         goto play_dvd_2;
         break;
    case evSetDVDTitle:
-        dvd_title=(int)param;
-        dvd_chapter=1;
-        dvd_angle=1;
-        guiIntfStruct.DVDChanged=1;
+        guiIntfStruct.DVD.current_title=(int)param;
+	guiIntfStruct.DVD.current_chapter=1;
+	guiIntfStruct.DVD.current_angle=1;
         goto play_dvd_2;
         break;
 #endif
@@ -439,7 +433,6 @@
           item=&appMPlayer.Items[SelectedItem];
           itemtype=item->type;
           item->pressed=btnPressed;
-          item->used=1;
           switch( item->type )
            {
             case itButton:
@@ -461,7 +454,6 @@
            {
             case itPotmeter:
             case itHPotmeter:
-                 item->used=0;
                  btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
                  switch ( item->msg )
                   {
@@ -489,7 +481,6 @@
           item=&appMPlayer.Items[currentselected];
           if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
            {
-            item->used=0;
             item->value+=value;
             btnModify( item->msg,item->value );
             switch ( item->msg )

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- play.c	11 Mar 2002 09:19:14 -0000	1.52
+++ play.c	17 Apr 2002 21:12:11 -0000	1.53
@@ -9,6 +9,7 @@
 #include "../../config.h"
 #include "../../help_mp.h"
 #include "../../libvo/x11_common.h"
+#include "../../input/input.h"
 
 #include "../app.h"
 
@@ -65,13 +66,13 @@
  guiIntfStruct.TimeSec=0;
  guiIntfStruct.Position=0;
  guiIntfStruct.AudioType=0;
+ mplState();
 // if ( !guiIntfStruct.Playing ) return;
  if ( !appMPlayer.subWindow.isFullScreen )
   {
    wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
    wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
   }
- guiGetEvent( guiCEvent,guiSetStop );
  mplSubRender=1;
  wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
  wsClearWindow( appMPlayer.subWindow );
@@ -93,16 +94,10 @@
 
 void mplPause( void )
 {
- switch( guiIntfStruct.Playing )
-  {
-   case 1: // playing
-        guiIntfStruct.Playing=2;
-        break;
-   case 2: // paused
-        guiIntfStruct.Playing=1;
-        break;
-  }
- mplState();
+ mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) );
+ cmd->id=MP_CMD_PAUSE;
+ cmd->name=strdup("pause");
+ mp_input_queue_cmd(cmd);
  mplSubRender=0;
 }
 




More information about the MPlayer-cvslog mailing list