mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 00:06:25 +01:00
better dvd support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3619 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4854fe36ae
commit
44d4752274
@ -13,7 +13,7 @@
|
||||
|
||||
void ActivateMenuItem( int Item )
|
||||
{
|
||||
// fprintf( stderr,"[menu] item: %d\n",Item );
|
||||
// fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
|
||||
gtkShMem->popupmenu=Item & 0x0000ffff;
|
||||
gtkShMem->popupmenuparam=Item >> 16;
|
||||
gtkShMem->visiblepopupmenu=0;
|
||||
|
@ -197,6 +197,8 @@ drawrenderedtext:
|
||||
#define IZE(x) printf("@@@ " x " @@@\n");
|
||||
|
||||
extern void exit_player(char* how);
|
||||
extern int audio_id;
|
||||
extern int dvdsub_id;
|
||||
|
||||
void mplMsgHandle( int msg,float param )
|
||||
{
|
||||
@ -212,16 +214,19 @@ void mplMsgHandle( int msg,float param )
|
||||
|
||||
#ifdef USE_DVDREAD
|
||||
case evPlayDVD:
|
||||
dvd_title=1;
|
||||
dvd_chapter=1;
|
||||
dvd_angle=1;
|
||||
play_dvd_2:
|
||||
mplShMem->StreamType=STREAMTYPE_DVD;
|
||||
#endif
|
||||
|
||||
case evPlay:
|
||||
case evPlaySwitchToPause:
|
||||
btnModify( evPlaySwitchToPause,btnDisabled );
|
||||
btnModify( evPauseSwitchToPlay,btnReleased );
|
||||
if ( ( msg == evPlaySwitchToPause )&( mplShMem->Playing == 1 ) ) goto NoPause;
|
||||
mplMainRender=1;
|
||||
|
||||
|
||||
switch ( mplShMem->StreamType )
|
||||
{
|
||||
case STREAMTYPE_STREAM:
|
||||
@ -231,9 +236,6 @@ void mplMsgHandle( int msg,float param )
|
||||
break;
|
||||
#ifdef USE_DVDREAD
|
||||
case STREAMTYPE_DVD:
|
||||
dvd_title=1;
|
||||
dvd_chapter=1;
|
||||
dvd_angle=1;
|
||||
strcpy( mplShMem->Filename,"/dev/dvd" );
|
||||
break;
|
||||
#endif
|
||||
@ -241,30 +243,48 @@ void mplMsgHandle( int msg,float param )
|
||||
mplPlay();
|
||||
break;
|
||||
case evSetDVDSubtitle:
|
||||
#ifdef USE_DVDREAD
|
||||
dvdsub_id=(int)param;
|
||||
dvd_title=mplShMem->DVD.current_title;
|
||||
dvd_angle=mplShMem->DVD.current_angle;
|
||||
dvd_chapter=mplShMem->DVD.current_chapter;
|
||||
mplShMem->DVDChanged=1;
|
||||
goto play_dvd_2;
|
||||
#endif
|
||||
break;
|
||||
case evSetDVDAudio:
|
||||
#ifdef USE_DVDREAD
|
||||
audio_id=(int)param;
|
||||
dvd_title=mplShMem->DVD.current_title;
|
||||
dvd_angle=mplShMem->DVD.current_angle;
|
||||
dvd_chapter=mplShMem->DVD.current_chapter;
|
||||
mplShMem->DVDChanged=1;
|
||||
goto play_dvd_2;
|
||||
#endif
|
||||
break;
|
||||
case evSetDVDChapter:
|
||||
mplStop();
|
||||
dvd_title=mplShMem->DVD.current_title - 1;
|
||||
dvd_angle=mplShMem->DVD.current_angle - 1;
|
||||
#ifdef USE_DVDREAD
|
||||
dvd_title=mplShMem->DVD.current_title;
|
||||
dvd_angle=mplShMem->DVD.current_angle;
|
||||
dvd_chapter=(int)param;
|
||||
strcpy( mplShMem->Filename,"/dev/dvd" );
|
||||
mplPlay();
|
||||
mplShMem->DVDChanged=1;
|
||||
goto play_dvd_2;
|
||||
#endif
|
||||
break;
|
||||
case evSetDVDTitle:
|
||||
mplStop();
|
||||
#ifdef USE_DVDREAD
|
||||
dvd_title=(int)param;
|
||||
dvd_chapter=1;
|
||||
dvd_angle=1;
|
||||
strcpy( mplShMem->Filename,"/dev/dvd" );
|
||||
mplPlay();
|
||||
mplShMem->DVDChanged=1;
|
||||
goto play_dvd_2;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case evPause:
|
||||
case evPauseSwitchToPlay:
|
||||
btnModify( evPlaySwitchToPause,btnReleased );
|
||||
btnModify( evPauseSwitchToPlay,btnDisabled );
|
||||
// btnModify( evPlaySwitchToPause,btnReleased );
|
||||
// btnModify( evPauseSwitchToPlay,btnDisabled );
|
||||
NoPause:
|
||||
mplMainRender=1;
|
||||
mplPause();
|
||||
|
@ -58,6 +58,7 @@ typedef struct
|
||||
mplUnknowErrorStruct error;
|
||||
#ifdef USE_DVDREAD
|
||||
mplDVDStruct DVD;
|
||||
int DVDChanged;
|
||||
#endif
|
||||
|
||||
int Playing;
|
||||
|
32
mplayer.c
32
mplayer.c
@ -188,7 +188,7 @@ int allow_dshow=0;
|
||||
// streaming:
|
||||
int audio_id=-1;
|
||||
int video_id=-1;
|
||||
static int dvdsub_id=-1;
|
||||
int dvdsub_id=-1;
|
||||
static int vcd_track=0;
|
||||
|
||||
// cache2:
|
||||
@ -628,7 +628,7 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){
|
||||
printf("Using %s timing\n",softsleep?"software":"usleep()");
|
||||
|
||||
#ifdef USE_TERMCAP
|
||||
load_termcap(NULL); // load key-codes
|
||||
if ( !use_gui ) load_termcap(NULL); // load key-codes
|
||||
#endif
|
||||
|
||||
// ========== Init keyboard FIFO (connection to libvo) ============
|
||||
@ -657,6 +657,17 @@ play_next_file:
|
||||
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if ( use_gui ) {
|
||||
|
||||
#ifdef USE_DVDREAD
|
||||
if ( mplShMem->DVDChanged )
|
||||
{
|
||||
mplShMem->DVDChanged=0;
|
||||
mplShMem->Playing=1;
|
||||
filename="/dev/dvd";
|
||||
goto play_dvd;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(filename && !mplShMem->FilenameChanged) strcpy( mplShMem->Filename,filename );
|
||||
// mplShMem->Playing= (gui_no_filename) ? 0 : 1;
|
||||
while(mplShMem->Playing!=1){
|
||||
@ -664,6 +675,8 @@ play_next_file:
|
||||
EventHandling();
|
||||
}
|
||||
|
||||
play_dvd:
|
||||
|
||||
#ifdef USE_SUB
|
||||
if ( mplShMem->SubtitleChanged || !mplShMem->FilenameChanged )
|
||||
{
|
||||
@ -2095,6 +2108,7 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
}
|
||||
mplShMem->Volume=(float)mixer_getbothvolume();
|
||||
#ifdef USE_DVDREAD
|
||||
if ( mplShMem->DVDChanged ) goto goto_next_file;
|
||||
if ( stream->type == STREAMTYPE_DVD )
|
||||
{
|
||||
dvd_priv_t * dvdp = stream->priv;
|
||||
@ -2164,6 +2178,7 @@ mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",eof);
|
||||
|
||||
}
|
||||
|
||||
goto_next_file: // don't jump here after ao/vo/getch initialization!
|
||||
|
||||
if(curr_filename+1<num_filenames || use_gui){
|
||||
// partial uninit:
|
||||
@ -2172,16 +2187,21 @@ if(curr_filename+1<num_filenames || use_gui){
|
||||
|
||||
}
|
||||
|
||||
goto_next_file: // don't jump here after ao/vo/getch initialization!
|
||||
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if(use_gui)
|
||||
{
|
||||
mplStop();
|
||||
#ifdef USE_DVDREAD
|
||||
if ( !mplShMem->DVDChanged )
|
||||
#endif
|
||||
mplStop();
|
||||
}
|
||||
#endif
|
||||
|
||||
if(use_gui || ++curr_filename<num_filenames){
|
||||
if(use_gui || ++curr_filename<num_filenames
|
||||
#if defined( HAVE_NEW_GUI ) && defined( USE_DVDREAD )
|
||||
|| mplShMem->DVDChanged
|
||||
#endif
|
||||
){
|
||||
|
||||
current_module="uninit_vcodec";
|
||||
if(sh_video) uninit_video(sh_video);
|
||||
|
Loading…
Reference in New Issue
Block a user