comparison mplayer.c @ 4974:5da7b1522a9f

small bug fixed and workarounds :(
author pontscho
date Thu, 07 Mar 2002 11:57:33 +0000
parents 923605707de6
children bfc652fc7f43
comparison
equal deleted inserted replaced
4973:544c1dae591c 4974:5da7b1522a9f
747 747
748 #ifdef HAVE_NEW_GUI 748 #ifdef HAVE_NEW_GUI
749 if(use_gui){ 749 if(use_gui){
750 guiInit( argc,argv,envp ); 750 guiInit( argc,argv,envp );
751 inited_flags|=INITED_GUI; 751 inited_flags|=INITED_GUI;
752 guiGetEvent( guiCEvent,(gui_no_filename) ? 0 : 1 ); 752 guiGetEvent( guiCEvent,(char *)((gui_no_filename) ? 0 : 1) );
753 } 753 }
754 #endif 754 #endif
755 755
756 play_next_file: 756 play_next_file:
757 757
767 767
768 #ifdef USE_DVDREAD 768 #ifdef USE_DVDREAD
769 if ( guiIntfStruct.DVDChanged ) 769 if ( guiIntfStruct.DVDChanged )
770 { 770 {
771 guiIntfStruct.DVDChanged=0; 771 guiIntfStruct.DVDChanged=0;
772 guiGetEvent( guiCEvent,guiSetPlay ); 772 guiGetEvent( guiCEvent,(char *)guiSetPlay );
773 filename="/dev/dvd"; 773 filename="/dev/dvd";
774 goto play_dvd; 774 goto play_dvd;
775 } 775 }
776 #endif 776 #endif
777 777
793 #endif 793 #endif
794 if ( guiIntfStruct.FilenameChanged || !filename ) 794 if ( guiIntfStruct.FilenameChanged || !filename )
795 { 795 {
796 play_tree_t * entry = play_tree_new(); 796 play_tree_t * entry = play_tree_new();
797 play_tree_add_file( entry,guiIntfStruct.Filename ); 797 play_tree_add_file( entry,guiIntfStruct.Filename );
798 if ( playtree ) 798 if ( playtree ) play_tree_free_list( playtree->child,1 );
799 else playtree=play_tree_new();
800 play_tree_set_child( playtree,entry );
801 if(playtree)
799 { 802 {
800 play_tree_free_list( playtree->child,1 ); 803 playtree_iter = play_tree_iter_new(playtree,mconfig);
801 play_tree_set_child( playtree,entry );
802 }
803 else
804 {
805 fprintf( stderr,"[mplayer] new playtree created.\n" );
806 if ( !playtree ) playtree=play_tree_new();
807 play_tree_set_child( playtree,entry );
808 }
809
810 if(playtree->child)
811 {
812 playtree_iter = play_tree_iter_new(playtree->child,mconfig);
813 if(playtree_iter) 804 if(playtree_iter)
814 { 805 {
815 if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) 806 if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY)
816 { 807 {
817 play_tree_iter_free(playtree_iter); 808 play_tree_iter_free(playtree_iter);
818 playtree_iter = NULL; 809 playtree_iter = NULL;
819 } 810 }
820 filename = play_tree_iter_get_file(playtree_iter,1); 811 filename = play_tree_iter_get_file(playtree_iter,1);
821 } 812 }
822 } 813 }
814 // filename=playtree->child->files[0];
823 guiIntfStruct.FilenameChanged=0; 815 guiIntfStruct.FilenameChanged=0;
824 } 816 }
825 } 817 }
826 #endif 818 #endif
827 819
828 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename); 820 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename);
829 821
2032 if(!quiet) { 2024 if(!quiet) {
2033 mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\n------ PAUSED -------\r"); 2025 mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\n------ PAUSED -------\r");
2034 fflush(stdout); 2026 fflush(stdout);
2035 } 2027 }
2036 #ifdef HAVE_NEW_GUI 2028 #ifdef HAVE_NEW_GUI
2037 if(use_gui) guiGetEvent( guiCEvent,guiSetPause ); 2029 if(use_gui) guiGetEvent( guiCEvent,(char *)guiSetPause );
2038 #endif 2030 #endif
2039 if (video_out && sh_video) 2031 if (video_out && sh_video)
2040 video_out->control(VOCTRL_PAUSE, NULL); 2032 video_out->control(VOCTRL_PAUSE, NULL);
2041 2033
2042 if (audio_out && sh_audio) 2034 if (audio_out && sh_audio)
2089 audio_out->resume(); // resume audio 2081 audio_out->resume(); // resume audio
2090 if (video_out && sh_video) 2082 if (video_out && sh_video)
2091 video_out->control(VOCTRL_RESUME, NULL); // resume video 2083 video_out->control(VOCTRL_RESUME, NULL); // resume video
2092 (void)GetRelativeTime(); // keep TF around FT in next cycle 2084 (void)GetRelativeTime(); // keep TF around FT in next cycle
2093 #ifdef HAVE_NEW_GUI 2085 #ifdef HAVE_NEW_GUI
2094 if (use_gui) guiGetEvent( guiCEvent,guiSetPlay ); 2086 if (use_gui) guiGetEvent( guiCEvent,(char *)guiSetPlay );
2095 #endif 2087 #endif
2096 } 2088 }
2097 2089
2098 2090
2099 if(!force_redraw) break; 2091 if(!force_redraw) break;
2901 in RAM and kernel+other_tasks eat 0% of CPU. */ 2893 in RAM and kernel+other_tasks eat 0% of CPU. */
2902 mp_msg(MSGT_CPLAYER,MSGL_INFO,"TOTAL BENCHMARK: from %u frames should be dropped: %u at least\n" 2894 mp_msg(MSGT_CPLAYER,MSGL_INFO,"TOTAL BENCHMARK: from %u frames should be dropped: %u at least\n"
2903 ,our_n_frames,bench_dropped_frames); 2895 ,our_n_frames,bench_dropped_frames);
2904 } 2896 }
2905 2897
2898 #ifdef HAVE_NEW_GUI
2899 if( use_gui )
2900 {
2901 #ifdef USE_DVDREAD
2902 if ( !guiIntfStruct.DVDChanged )
2903 #endif
2904 mplStop();
2905 #warning workaround for kiba playtree with gui ... if i dont play the prev/next file, then playtree sig6 (assert)
2906 eof=0;
2907 }
2908 #endif
2909
2906 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) { 2910 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {
2907 eof = eof == PT_NEXT_ENTRY ? 1 : -1; 2911 eof = eof == PT_NEXT_ENTRY ? 1 : -1;
2908 if(play_tree_iter_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) { 2912 if(play_tree_iter_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) {
2909 uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT+INITED_VO)); 2913 uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT+INITED_VO));
2910 eof = 1; 2914 eof = 1;
2927 } 2931 }
2928 2932
2929 uninit_player(INITED_VO); 2933 uninit_player(INITED_VO);
2930 2934
2931 if(eof == 0) eof = 1; 2935 if(eof == 0) eof = 1;
2932
2933 #ifdef HAVE_NEW_GUI
2934 if(use_gui)
2935 {
2936 #ifdef USE_DVDREAD
2937 if ( !guiIntfStruct.DVDChanged )
2938 #endif
2939 mplStop();
2940 }
2941 #endif
2942 2936
2943 while(playtree_iter != NULL) { 2937 while(playtree_iter != NULL) {
2944 filename = play_tree_iter_get_file(playtree_iter,eof); 2938 filename = play_tree_iter_get_file(playtree_iter,eof);
2945 if(filename == NULL) { 2939 if(filename == NULL) {
2946 if( play_tree_iter_step(playtree_iter,eof,0) != PLAY_TREE_ITER_ENTRY) { 2940 if( play_tree_iter_step(playtree_iter,eof,0) != PLAY_TREE_ITER_ENTRY) {