Mercurial > mplayer.hg
comparison mplayer.c @ 3499:93351eec9f1f
Add subtitle loader for gui
author | pontscho |
---|---|
date | Sat, 15 Dec 2001 15:36:07 +0000 |
parents | 47983b6a042d |
children | 19998399f4d5 |
comparison
equal
deleted
inserted
replaced
3498:ee97a542fec1 | 3499:93351eec9f1f |
---|---|
587 if(!vo_font) | 587 if(!vo_font) |
588 vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1); | 588 vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1); |
589 } | 589 } |
590 #endif | 590 #endif |
591 | 591 |
592 #ifdef USE_SUB | |
593 // check .sub | |
594 if(sub_name){ | |
595 int l=strlen(sub_name); | |
596 if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf")) | |
597 ||(0==strcmp(&sub_name[l-4],".UTF")))) | |
598 sub_utf8=1; | |
599 subtitles=sub_read_file(sub_name); | |
600 if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); | |
601 } | |
602 #endif | |
603 | |
604 // It's time to init the GUI code: (and fork() the GTK process) | 592 // It's time to init the GUI code: (and fork() the GTK process) |
605 #ifdef HAVE_NEW_GUI | 593 #ifdef HAVE_NEW_GUI |
606 if(use_gui){ | 594 if(use_gui){ |
607 appInit( argc,argv,envp,(void*)mDisplay ); | 595 appInit( argc,argv,envp,(void*)mDisplay ); |
608 inited_flags|=INITED_GUI; | 596 inited_flags|=INITED_GUI; |
676 EventHandling(); | 664 EventHandling(); |
677 } | 665 } |
678 if(mplShMem->FilenameChanged){ | 666 if(mplShMem->FilenameChanged){ |
679 filename=mplShMem->Filename; | 667 filename=mplShMem->Filename; |
680 } | 668 } |
669 #ifdef USE_SUB | |
670 sub_name=NULL; | |
671 if ( mplShMem->SubtitleChanged ) sub_name=mplShMem->Subtitlename; | |
672 #endif | |
681 } | 673 } |
682 #endif | 674 #endif |
683 | 675 |
684 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename); | 676 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename); |
685 | 677 |
686 #ifdef USE_SUB | 678 #ifdef USE_SUB |
687 // check .sub | 679 // check .sub |
680 if(sub_name){ | |
681 int l=strlen(sub_name); | |
682 if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf")) | |
683 ||(0==strcmp(&sub_name[l-4],".UTF")))) | |
684 sub_utf8=1; | |
685 subtitles=sub_read_file(sub_name); | |
686 if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); | |
687 } | |
688 if(!sub_name){ | 688 if(!sub_name){ |
689 if(sub_auto && filename) { // auto load sub file ... | 689 if(sub_auto && filename) { // auto load sub file ... |
690 subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) ); | 690 subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) ); |
691 } | 691 } |
692 if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default | 692 if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default |