Update of /cvsroot/mplayer/main/Gui In directory mail:/var/tmp.root/cvs-serv10173/Gui Modified Files: interface.c Log Message: support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl> Index: interface.c =================================================================== RCS file: /cvsroot/mplayer/main/Gui/interface.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- interface.c 3 Apr 2003 12:09:42 -0000 1.83 +++ interface.c 7 Apr 2003 16:04:02 -0000 1.84 @@ -328,7 +328,7 @@ if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE ); if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); - if ( sub_name ) guiSetFilename( guiIntfStruct.Subtitlename,sub_name ); + if ( subdata ) guiSetFilename( guiIntfStruct.Subtitlename, subdata->filename ); #if defined( USE_OSD ) || defined( USE_SUB ) guiLoadFont(); #endif @@ -416,19 +416,20 @@ #ifdef USE_SUB extern mp_osd_obj_t* vo_osd_list; +extern char **sub_name; + void guiLoadSubtitle( char * name ) { if ( guiIntfStruct.Playing == 0 ) { - guiIntfStruct.SubtitleChanged=1; + guiIntfStruct.SubtitleChanged=1; //what is this for? (mw) return; } - if ( subtitles ) + if ( subdata ) { mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete subtitles.\n" ); - sub_free( subtitles ); - subtitles=NULL; - gfree( (void **)&sub_name ); + sub_free( subdata ); + subdata=NULL; vo_sub=NULL; if ( vo_osd_list ) { @@ -449,11 +450,15 @@ } if ( name ) { - mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Delete Load subtitle: %s\n",name ); - sub_name=gstrdup( name ); - subtitles=sub_read_file( sub_name,guiIntfStruct.FPS ); - if ( !subtitles ) mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_CantLoadSub,name ); + mp_msg( MSGT_GPLAYER,MSGL_INFO,"[gui] Load subtitle: %s\n",name ); + subdata=sub_read_file( gstrdup( name ), guiIntfStruct.FPS ); + if ( !subdata ) mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_CantLoadSub,name ); + sub_name = (malloc(2 * sizeof(char*))); //when mplayer will be restarted + sub_name[0] = strdup(name); //sub_name[0] will be read + sub_name[1] = NULL; } + update_set_of_subtitles(); + } #endif @@ -797,7 +802,7 @@ #endif // -- subtitle #ifdef USE_SUB - sub_name=gstrdup( guiIntfStruct.Subtitlename ); + //subdata->filename=gstrdup( guiIntfStruct.Subtitlename ); stream_dump_type=0; if ( gtkSubDumpMPSub ) stream_dump_type=4; if ( gtkSubDumpSrt ) stream_dump_type=6;