1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-09 19:22:05 +00:00

- fix three submenu bug

- audio/video track hiding
	- normal/double/fullscreen handling
	- dvd audio channel setting bug
- fix file/url/vcd/dvd playing
- fix variables initialization
- some small bug fix
- applied some patch from Rüdiger Kuhlmann


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8424 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2002-12-11 01:21:12 +00:00
parent d9b33edbba
commit 15dc6ef3f7
9 changed files with 109 additions and 78 deletions

View File

@ -13,6 +13,7 @@
#include "mplayer/gtk/eq.h" #include "mplayer/gtk/eq.h"
#include "mplayer/widgets.h" #include "mplayer/widgets.h"
#include "mplayer/mplayer.h" #include "mplayer/mplayer.h"
#include "mplayer/play.h"
#include "../mplayer.h" #include "../mplayer.h"
#include "app.h" #include "app.h"
@ -264,6 +265,7 @@ void guiInit( void )
mplSubRender=1; mplSubRender=1;
// --- // ---
if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE );
if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name ); if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name );
#if defined( USE_OSD ) || defined( USE_SUB ) #if defined( USE_OSD ) || defined( USE_SUB )
@ -435,10 +437,11 @@ int guiGetEvent( int type,char * arg )
case guiCEvent: case guiCEvent:
switch ( (int)arg ) switch ( (int)arg )
{ {
case guiSetPlay: guiIntfStruct.Playing=1; mplState(); break; case guiSetPlay: guiIntfStruct.Playing=1; break;
case guiSetStop: guiIntfStruct.Playing=0; mplState(); break; case guiSetStop: guiIntfStruct.Playing=0; break;
case guiSetPause: guiIntfStruct.Playing=2; mplState(); break; case guiSetPause: guiIntfStruct.Playing=2; break;
} }
mplState();
break; break;
case guiSetState: case guiSetState:
mplState(); mplState();
@ -451,9 +454,6 @@ int guiGetEvent( int type,char * arg )
if ( (int)arg ) { guiIntfStruct.NoWindow=True; wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); } if ( (int)arg ) { guiIntfStruct.NoWindow=True; wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); }
else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
break; break;
case guiReDrawSubWindow:
wsPostRedisplay( &appMPlayer.subWindow );
break;
case guiSetDemuxer: case guiSetDemuxer:
guiIntfStruct.demuxer=(void *)arg; guiIntfStruct.demuxer=(void *)arg;
break; break;
@ -500,8 +500,6 @@ int guiGetEvent( int type,char * arg )
if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break; if ( vcd_seek_to_track( stream->fd,i ) < 0 ) break;
vcd_seek_to_track( stream->fd,vcd_track ); vcd_seek_to_track( stream->fd,vcd_track );
guiIntfStruct.VCDTracks=--i; guiIntfStruct.VCDTracks=--i;
mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] vcd tracks: %d\n",guiIntfStruct.VCDTracks );
guiIntfStruct.Track=vcd_track;
break; break;
} }
#endif #endif
@ -554,12 +552,6 @@ int guiGetEvent( int type,char * arg )
if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) btnSet( evSetMoviePosition,btnDisabled ); if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) btnSet( evSetMoviePosition,btnDisabled );
else btnSet( evSetMoviePosition,btnReleased ); else btnSet( evSetMoviePosition,btnReleased );
if ( gtkCacheOn ) stream_cache_size=gtkCacheSize;
else stream_cache_size=-1;
if ( gtkAutoSyncOn ) autosync=gtkAutoSync;
else autosync=0;
// -- audio // -- audio
if ( audio_out ) if ( audio_out )
{ {
@ -604,14 +596,42 @@ int guiGetEvent( int type,char * arg )
#endif #endif
break; break;
case guiSetDefaults: case guiSetDefaults:
if ( filename && !guiIntfStruct.Filename ) if ( guiIntfStruct.Playing == 1 && guiIntfStruct.FilenameChanged )
{ {
gtkSet( gtkDelPl,0,NULL ); guiIntfStruct.StreamType=STREAMTYPE_FILE; audio_id=-1;
guiSetFilename( guiIntfStruct.Filename,filename ); video_id=-1;
dvdsub_id=-1;
vobsub_id=-1;
stream_cache_size=-1;
autosync=0;
vcd_track=0;
dvd_title=0;
}
wsPostRedisplay( &appMPlayer.subWindow );
break;
case guiSetParameters:
switch ( guiIntfStruct.StreamType )
{
case STREAMTYPE_PLAYLIST:
break;
#ifdef HAVE_VCD
case STREAMTYPE_VCD:
vcd_track=guiIntfStruct.Track;
break;
#endif
#ifdef USE_DVDREAD
case STREAMTYPE_DVD:
dvd_title=guiIntfStruct.Title;
dvd_chapter=guiIntfStruct.Chapter;
dvd_angle=guiIntfStruct.Angle;
break;
#endif
}
if ( guiIntfStruct.StreamType != STREAMTYPE_PLAYLIST )
{
if ( guiIntfStruct.Filename ) filename=gstrdup( guiIntfStruct.Filename );
else if ( filename ) guiSetFilename( guiIntfStruct.Filename,filename );
} }
guiIntfStruct.DiskChanged=0;
// --- video opts // --- video opts
if ( !video_driver_list ) if ( !video_driver_list )
@ -674,7 +694,7 @@ int guiGetEvent( int type,char * arg )
mixer_device=gtkAOOSSMixer; mixer_device=gtkAOOSSMixer;
if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"oss",3 ) && gtkAOOSSDevice ) if ( audio_driver_list && !gstrncmp( audio_driver_list[0],"oss",3 ) && gtkAOOSSDevice )
{ {
char * tmp = calloc( 1,strlen( gtkAOOSSDevice ) + 5 ); char * tmp = calloc( 1,strlen( gtkAOOSSDevice ) + 7 );
sprintf( tmp,"oss:%s",gtkAOOSSDevice ); sprintf( tmp,"oss:%s",gtkAOOSSDevice );
gaddlist( &audio_driver_list,tmp ); gaddlist( &audio_driver_list,tmp );
} }
@ -692,9 +712,19 @@ int guiGetEvent( int type,char * arg )
#endif #endif
// --- misc // --- misc
if ( gtkCacheOn ) stream_cache_size=gtkCacheSize;
else stream_cache_size=-1;
if ( gtkAutoSyncOn ) autosync=gtkAutoSync;
else autosync=0;
if ( guiIntfStruct.AudioFile ) audio_stream=guiIntfStruct.AudioFile; if ( guiIntfStruct.AudioFile ) audio_stream=guiIntfStruct.AudioFile;
else if ( guiIntfStruct.FilenameChanged ) audio_stream=NULL; else if ( guiIntfStruct.FilenameChanged ) audio_stream=NULL;
guiIntfStruct.DiskChanged=0;
guiIntfStruct.FilenameChanged=0;
guiIntfStruct.NewPlay=0;
break; break;
} }
return False; return False;

View File

@ -63,9 +63,13 @@ typedef struct
void * event_struct; void * event_struct;
int DiskChanged; int DiskChanged;
int NewPlay;
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
guiDVDStruct DVD; guiDVDStruct DVD;
int Title;
int Angle;
int Chapter;
#endif #endif
#ifdef HAVE_VCD #ifdef HAVE_VCD
@ -125,6 +129,7 @@ extern guiInterface_t guiIntfStruct;
#define guiSetValues 13 #define guiSetValues 13
#define guiSetFileFormat 14 #define guiSetFileFormat 14
#define guiSetDemuxer 15 #define guiSetDemuxer 15
#define guiSetParameters 16
#define guiSetStop 0 #define guiSetStop 0
#define guiSetPlay 1 #define guiSetPlay 1

View File

@ -379,14 +379,15 @@ GtkWidget * create_PopUpMenu( void )
DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages ); DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages );
if ( guiIntfStruct.DVD.nr_of_audio_channels ) if ( guiIntfStruct.DVD.nr_of_audio_channels )
{ {
char tmp[64]; int i; char tmp[64]; int i, id = audio_id;
for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ )
{ {
snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ),
ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ],
ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] );
if ( id == -1 ) id=guiIntfStruct.DVD.audio_streams[i].id;
AddMenuCheckItem( DVDAudioLanguageMenu,tmp, AddMenuCheckItem( DVDAudioLanguageMenu,tmp,
audio_id == guiIntfStruct.DVD.audio_streams[i].id, id == guiIntfStruct.DVD.audio_streams[i].id,
( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
} }
} }
@ -424,7 +425,7 @@ GtkWidget * create_PopUpMenu( void )
AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
} }
if ( guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD ) if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD )
{ {
int i,c = 0; int i,c = 0;

View File

@ -252,6 +252,7 @@ extern int osd_visible;
void mplEventHandling( int msg,float param ) void mplEventHandling( int msg,float param )
{ {
int j; int j;
int iparam = (int)param;
switch( msg ) switch( msg )
{ {
@ -270,22 +271,20 @@ void mplEventHandling( int msg,float param )
break; break;
case evSetAudio: case evSetAudio:
if ( !guiIntfStruct.demuxer ) break; if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
audio_id=(int)param; audio_id=iparam;
if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play; guiIntfStruct.NewPlay=1;
guiIntfStruct.FilenameChanged=1;
break; break;
case evSetVideo: case evSetVideo:
if ( !guiIntfStruct.demuxer ) break; if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
video_id=(int)param; video_id=iparam;
if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play; guiIntfStruct.NewPlay=1;
guiIntfStruct.FilenameChanged=1;
break; break;
#ifdef HAVE_VCD #ifdef HAVE_VCD
case evSetVCDTrack: case evSetVCDTrack:
guiIntfStruct.Track=(int)param; guiIntfStruct.Track=iparam;
case evPlayVCD: case evPlayVCD:
gtkSet( gtkClearStruct,0,(void *)guiALL ); gtkSet( gtkClearStruct,0,(void *)guiALL );
guiIntfStruct.StreamType=STREAMTYPE_VCD; guiIntfStruct.StreamType=STREAMTYPE_VCD;
@ -299,6 +298,7 @@ void mplEventHandling( int msg,float param )
play_dvd_2: play_dvd_2:
gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) ); gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
guiIntfStruct.StreamType=STREAMTYPE_DVD; guiIntfStruct.StreamType=STREAMTYPE_DVD;
goto play;
#endif #endif
case evPlay: case evPlay:
case evPlaySwitchToPause: case evPlaySwitchToPause:
@ -306,18 +306,11 @@ play:
if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause; if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause;
vcd_track=0;
dvd_title=0;
if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) ) if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) )
{ {
plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL ); plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
plLastPlayed=next; plLastPlayed=next;
guiSetDF( guiIntfStruct.Filename,next->path,next->name ); mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
guiIntfStruct.StreamType=STREAMTYPE_FILE;
guiIntfStruct.FilenameChanged=1;
gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename );
} }
switch ( guiIntfStruct.StreamType ) switch ( guiIntfStruct.StreamType )
@ -335,10 +328,9 @@ play:
{ {
if ( !guiIntfStruct.Track ) if ( !guiIntfStruct.Track )
{ {
if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1; if ( guiIntfStruct.VCDTracks > 1 ) guiIntfStruct.Track=2;
else guiIntfStruct.Track=2; else guiIntfStruct.Track=1;
} }
vcd_track=guiIntfStruct.Track;
guiIntfStruct.DiskChanged=1; guiIntfStruct.DiskChanged=1;
} }
break; break;
@ -350,31 +342,32 @@ play:
mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD ); mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
if ( guiIntfStruct.Playing != 2 ) if ( guiIntfStruct.Playing != 2 )
{ {
dvd_title=guiIntfStruct.DVD.current_title; guiIntfStruct.Title=guiIntfStruct.DVD.current_title;
dvd_angle=guiIntfStruct.DVD.current_angle; guiIntfStruct.Chapter=guiIntfStruct.DVD.current_chapter;
dvd_chapter=guiIntfStruct.DVD.current_chapter; guiIntfStruct.Angle=guiIntfStruct.DVD.current_angle;
guiIntfStruct.DiskChanged=1; guiIntfStruct.DiskChanged=1;
} }
break; break;
#endif #endif
} }
guiIntfStruct.NewPlay=1;
mplPlay(); mplPlay();
break; break;
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
case evSetDVDSubtitle: case evSetDVDSubtitle:
dvdsub_id=(int)param; dvdsub_id=iparam;
goto play_dvd_2; goto play_dvd_2;
break; break;
case evSetDVDAudio: case evSetDVDAudio:
audio_id=(int)param; audio_id=iparam;
goto play_dvd_2; goto play_dvd_2;
break; break;
case evSetDVDChapter: case evSetDVDChapter:
guiIntfStruct.DVD.current_chapter=(int)param; guiIntfStruct.DVD.current_chapter=iparam;
goto play_dvd_2; goto play_dvd_2;
break; break;
case evSetDVDTitle: case evSetDVDTitle:
guiIntfStruct.DVD.current_title=(int)param; guiIntfStruct.DVD.current_title=iparam;
guiIntfStruct.DVD.current_chapter=1; guiIntfStruct.DVD.current_chapter=1;
guiIntfStruct.DVD.current_angle=1; guiIntfStruct.DVD.current_angle=1;
goto play_dvd_2; goto play_dvd_2;
@ -387,7 +380,11 @@ NoPause:
mplPause(); mplPause();
break; break;
case evStop: guiIntfStruct.Playing=guiSetStop; mplState(); break; case evStop:
guiIntfStruct.Playing=guiSetStop;
mplState();
guiIntfStruct.NoWindow=False;
break;
case evLoadPlay: case evLoadPlay:
mplMainAutoPlay=1; mplMainAutoPlay=1;
@ -448,7 +445,7 @@ set_volume:
case evIconify: case evIconify:
switch ( (int)param ) switch ( iparam )
{ {
case 0: wsIconify( appMPlayer.mainWindow ); break; case 0: wsIconify( appMPlayer.mainWindow ); break;
case 1: wsIconify( appMPlayer.subWindow ); break; case 1: wsIconify( appMPlayer.subWindow ); break;
@ -489,7 +486,7 @@ set_volume:
break; break;
case evSetAspect: case evSetAspect:
switch ( (int)param ) switch ( iparam )
{ {
case 2: movie_aspect=16.0f / 9.0f; break; case 2: movie_aspect=16.0f / 9.0f; break;
case 3: movie_aspect=4.0f / 3.0f; break; case 3: movie_aspect=4.0f / 3.0f; break;
@ -499,10 +496,10 @@ set_volume:
} }
wsClearWindow( appMPlayer.subWindow ); wsClearWindow( appMPlayer.subWindow );
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play_dvd_2; if ( guiIntfStruct.StreamType == STREAMTYPE_DVD || guiIntfStruct.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
else else
#endif #endif
guiIntfStruct.FilenameChanged=1; guiIntfStruct.NewPlay=1;
break; break;
// --- timer events // --- timer events

View File

@ -10,6 +10,7 @@
#include "../wm/ws.h" #include "../wm/ws.h"
#include "../../config.h" #include "../../config.h"
#include "../../help_mp.h" #include "../../help_mp.h"
#include "../../mplayer.h"
#include "../../libvo/x11_common.h" #include "../../libvo/x11_common.h"
#include "../../input/input.h" #include "../../input/input.h"
@ -99,7 +100,7 @@ void mplEnd( void )
plLastPlayed=next; plLastPlayed=next;
guiSetDF( guiIntfStruct.Filename,next->path,next->name ); guiSetDF( guiIntfStruct.Filename,next->path,next->name );
guiIntfStruct.StreamType=STREAMTYPE_FILE; guiIntfStruct.StreamType=STREAMTYPE_FILE;
guiIntfStruct.FilenameChanged=1; guiIntfStruct.FilenameChanged=guiIntfStruct.NewPlay=1;
gfree( (void **)&guiIntfStruct.AudioFile ); gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename ); gfree( (void **)&guiIntfStruct.Subtitlename );
} }
@ -110,6 +111,8 @@ void mplEnd( void )
guiIntfStruct.TimeSec=0; guiIntfStruct.TimeSec=0;
guiIntfStruct.Position=0; guiIntfStruct.Position=0;
guiIntfStruct.AudioType=0; guiIntfStruct.AudioType=0;
guiIntfStruct.NoWindow=False;
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
guiIntfStruct.DVD.current_title=1; guiIntfStruct.DVD.current_title=1;
guiIntfStruct.DVD.current_chapter=1; guiIntfStruct.DVD.current_chapter=1;
@ -255,10 +258,10 @@ void mplSetFileName( char * dir,char * name,int type )
if ( !name ) return; if ( !name ) return;
if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name ) if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name )
else guiSetDF( guiIntfStruct.Filename,dir,name ) else guiSetDF( guiIntfStruct.Filename,dir,name );
// filename=guiIntfStruct.Filename;
guiIntfStruct.StreamType=type; guiIntfStruct.StreamType=type;
guiIntfStruct.FilenameChanged=1;
gfree( (void **)&guiIntfStruct.AudioFile ); gfree( (void **)&guiIntfStruct.AudioFile );
gfree( (void **)&guiIntfStruct.Subtitlename ); gfree( (void **)&guiIntfStruct.Subtitlename );
} }

View File

@ -234,7 +234,7 @@ int cmd_button( char * in )
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] x: %d y: %d sx: %d sy: %d\n",x,y,sx,sy ); mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] x: %d y: %d sx: %d sy: %d\n",x,y,sx,sy );
if ( ( defList->Items[ defList->NumberOfItems ].msg=appFindMessage( msg ) ) == -1 ) if ( ( defList->Items[ defList->NumberOfItems ].msg=appFindMessage( msg ) ) == -1 )
{ ERRORMESSAGE( MSGTR_SKIN_BITMAP_UnknownMessage,msg ); return 1; } { ERRORMESSAGE( MSGTR_SKIN_BITMAP_UnknownMessage,msg ); return 0; }
defList->Items[ defList->NumberOfItems ].pressed=btnReleased; defList->Items[ defList->NumberOfItems ].pressed=btnReleased;
if ( defList->Items[ defList->NumberOfItems ].msg == evPauseSwitchToPlay ) defList->Items[ defList->NumberOfItems ].pressed=btnDisabled; if ( defList->Items[ defList->NumberOfItems ].msg == evPauseSwitchToPlay ) defList->Items[ defList->NumberOfItems ].pressed=btnDisabled;
defList->Items[ defList->NumberOfItems ].tmp=1; defList->Items[ defList->NumberOfItems ].tmp=1;

View File

@ -868,8 +868,8 @@ if(!use_stdin && !slave_mode){
// =================== GUI idle loop (STOP state) =========================== // =================== GUI idle loop (STOP state) ===========================
#ifdef HAVE_NEW_GUI #ifdef HAVE_NEW_GUI
if ( use_gui ) { if ( use_gui ) {
file_format=DEMUXER_TYPE_UNKNOWN;
guiGetEvent( guiReDrawSubWindow,0 ); guiGetEvent( guiSetDefaults,0 );
while ( guiIntfStruct.Playing != 1 ) while ( guiIntfStruct.Playing != 1 )
{ {
mp_cmd_t* cmd; mp_cmd_t* cmd;
@ -878,14 +878,8 @@ if(!use_stdin && !slave_mode){
guiGetEvent( guiReDraw,NULL ); guiGetEvent( guiReDraw,NULL );
if ( (cmd = mp_input_get_cmd(0,0)) != NULL) guiGetEvent( guiIEvent,(char *)cmd->id ); if ( (cmd = mp_input_get_cmd(0,0)) != NULL) guiGetEvent( guiIEvent,(char *)cmd->id );
} }
guiGetEvent( guiSetParameters,NULL );
guiGetEvent( guiSetDefaults,NULL ); if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM )
if ( ( guiIntfStruct.FilenameChanged || !filename )
//#ifdef USE_DVDREAD
// && ( guiIntfStruct.StreamType != STREAMTYPE_DVD )
//#endif
)
{ {
play_tree_t * entry = play_tree_new(); play_tree_t * entry = play_tree_new();
play_tree_add_file( entry,guiIntfStruct.Filename ); play_tree_add_file( entry,guiIntfStruct.Filename );
@ -905,7 +899,6 @@ if(!use_stdin && !slave_mode){
filename = play_tree_iter_get_file(playtree_iter,1); filename = play_tree_iter_get_file(playtree_iter,1);
} }
} }
guiIntfStruct.FilenameChanged=0;
} }
} }
#endif #endif
@ -951,6 +944,10 @@ if(!use_stdin && !slave_mode){
} }
inited_flags|=INITED_STREAM; inited_flags|=INITED_STREAM;
#ifdef HAVE_NEW_GUI
if ( use_gui ) guiGetEvent( guiSetStream,(char *)stream );
#endif
if(stream->type == STREAMTYPE_PLAYLIST) { if(stream->type == STREAMTYPE_PLAYLIST) {
play_tree_t* entry; play_tree_t* entry;
// Handle playlist // Handle playlist
@ -1348,8 +1345,6 @@ fflush(stdout);
#ifdef HAVE_NEW_GUI #ifdef HAVE_NEW_GUI
if ( use_gui ) if ( use_gui )
{ {
guiGetEvent( guiSetStream,(char *)stream );
guiGetEvent( guiSetFileName,filename );
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0; if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 ); if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
guiGetEvent( guiSetFileFormat,(char *)demuxer->file_format ); guiGetEvent( guiSetFileFormat,(char *)demuxer->file_format );
@ -2700,12 +2695,11 @@ if(rel_seek_secs || abs_seek_pos){
guiGetEvent( guiSetVolume,NULL ); guiGetEvent( guiSetVolume,NULL );
if(guiIntfStruct.Playing==0) break; // STOP if(guiIntfStruct.Playing==0) break; // STOP
if(guiIntfStruct.Playing==2) osd_function=OSD_PAUSE; if(guiIntfStruct.Playing==2) osd_function=OSD_PAUSE;
if ( guiIntfStruct.DiskChanged || guiIntfStruct.FilenameChanged ) goto goto_next_file; if ( guiIntfStruct.DiskChanged || guiIntfStruct.NewPlay ) goto goto_next_file;
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
if ( stream->type == STREAMTYPE_DVD ) if ( stream->type == STREAMTYPE_DVD )
{ {
dvd_priv_t * dvdp = stream->priv; dvd_priv_t * dvdp = stream->priv;
/*guiIntfStruct.DVD.current_chapter=dvdp->cur_cell + 1;*/
guiIntfStruct.DVD.current_chapter=dvd_chapter_from_cell(dvdp,guiIntfStruct.DVD.current_title-1, dvdp->cur_cell)+1; guiIntfStruct.DVD.current_chapter=dvd_chapter_from_cell(dvdp,guiIntfStruct.DVD.current_title-1, dvdp->cur_cell)+1;
} }
#endif #endif

View File

@ -51,6 +51,7 @@ extern int auto_quality;
extern int audio_id; extern int audio_id;
extern int video_id; extern int video_id;
extern int dvdsub_id; extern int dvdsub_id;
extern int vobsub_id;
extern void exit_player(char* how); extern void exit_player(char* how);