diff options
Diffstat (limited to 'Gui')
-rw-r--r-- | Gui/interface.c | 26 | ||||
-rw-r--r-- | Gui/interface.h | 1 | ||||
-rw-r--r-- | Gui/mplayer/gtk/fs.c | 4 | ||||
-rw-r--r-- | Gui/mplayer/mw.h | 10 |
4 files changed, 35 insertions, 6 deletions
diff --git a/Gui/interface.c b/Gui/interface.c index 705f2e782b..246b8998c4 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -238,6 +238,27 @@ void guiLoadFont( void ) } #endif +#ifdef USE_SUB +void guiLoadSubtitle( char * name ) +{ + if ( guiIntfStruct.Playing == 0 ) + { + guiIntfStruct.SubtitleChanged=1; + return; + } + if ( subtitles ) + { + sub_free( subtitles ); + if ( sub_name ) free( sub_name ); + sub_name=NULL; + vo_sub=NULL; + subtitles=NULL; + } + sub_name=gstrdup( name ); + subtitles=sub_read_file( sub_name,guiIntfStruct.FPS ); +} +#endif + static void add_vop( char * str ) { mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[gui] add video filter: %s\n",str ); @@ -337,9 +358,11 @@ int guiGetEvent( int type,char * arg ) guiIntfStruct.StreamType=stream->type; switch( stream->type ) { +#ifdef USE_DVDREAD case STREAMTYPE_DVD: guiGetEvent( guiSetDVD,(char *)stream->priv ); break; +#endif #ifdef HAVE_VCD case STREAMTYPE_VCD: { @@ -353,6 +376,7 @@ int guiGetEvent( int type,char * arg ) break; } #endif + default: break; } break; case guiIEvent: @@ -391,6 +415,8 @@ int guiGetEvent( int type,char * arg ) // -- video if ( arg ) { + tmp_sh_video_t * sh = (tmp_sh_video_t *)arg; + guiIntfStruct.FPS=sh->fps; if ( vo_gamma_brightness == 1000 ) { vo_gamma_brightness=0; get_video_colors( (void *)arg,"brightness",&vo_gamma_brightness ); } if ( vo_gamma_contrast == 1000 ) diff --git a/Gui/interface.h b/Gui/interface.h index d6490a5800..b6e2a2bcf8 100644 --- a/Gui/interface.h +++ b/Gui/interface.h @@ -86,6 +86,7 @@ typedef struct int LengthInSec; int FrameDrop; int FileFormat; + float FPS; char * Filename; int FilenameChanged; diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index 7ef23fb2da..1bf9ed5c79 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -431,10 +431,12 @@ void fs_Ok_released( GtkButton * button,gpointer user_data ) gfree( (void **)&guiIntfStruct.AudioFile ); gfree( (void **)&guiIntfStruct.Subtitlename ); break; +#ifdef USE_SUB case fsSubtitleSelector: guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile ); - guiIntfStruct.SubtitleChanged=1; + guiLoadSubtitle( guiIntfStruct.Subtitlename ); break; +#endif case fsOtherSelector: guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile ); break; diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h index ba0ff8eed3..15f4146839 100644 --- a/Gui/mplayer/mw.h +++ b/Gui/mplayer/mw.h @@ -33,20 +33,20 @@ inline void TranslateFilename( int c,char * tmp ) else strcpy( tmp,guiIntfStruct.Filename ); if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0; if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0; - } else strcpy( tmp,"no file loaded" ); + } else strcpy( tmp,MSGTR_NoFileLoaded ); break; #ifdef USE_DVDREAD case STREAMTYPE_DVD: - if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,"chapter %d",guiIntfStruct.DVD.current_chapter ); - else strcat( tmp,"no chapter" ); + if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter ); + else strcat( tmp,MSGTR_NoChapter ); break; #endif #ifdef HAVE_VCD case STREAMTYPE_VCD: - sprintf( tmp,"VCD track %d",guiIntfStruct.Track ); + sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track ); break; #endif - default: strcpy( tmp,"no media opened" ); + default: strcpy( tmp,MSGTR_NoMediaOpened ); } if ( c ) { |