Mercurial > mplayer.hg
comparison mplayer.c @ 4807:156482788caf
osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
author | atmos4 |
---|---|
date | Fri, 22 Feb 2002 15:25:11 +0000 |
parents | c39affa2b376 |
children | 3473ca9ef158 |
comparison
equal
deleted
inserted
replaced
4806:a14eff26f66a | 4807:156482788caf |
---|---|
2698 | 2698 |
2699 //================= Update OSD ==================== | 2699 //================= Update OSD ==================== |
2700 #ifdef USE_OSD | 2700 #ifdef USE_OSD |
2701 if(osd_level>=2){ | 2701 if(osd_level>=2){ |
2702 int pts=d_video->pts; | 2702 int pts=d_video->pts; |
2703 char osd_text_tmp[50]; | |
2703 if(pts==osd_last_pts-1) ++pts; else osd_last_pts=pts; | 2704 if(pts==osd_last_pts-1) ++pts; else osd_last_pts=pts; |
2704 vo_osd_text=osd_text_buffer; | 2705 vo_osd_text=osd_text_buffer; |
2705 if (osd_show_sub_delay) { | 2706 if (osd_show_sub_delay) { |
2706 sprintf(vo_osd_text, "Sub delay: %d ms",(int)(sub_delay*1000)); | 2707 sprintf(osd_text_tmp, "Sub delay: %d ms",(int)(sub_delay*1000)); |
2707 osd_show_sub_delay--; | 2708 osd_show_sub_delay--; |
2708 } else | 2709 } else |
2709 if (osd_show_av_delay) { | 2710 if (osd_show_av_delay) { |
2710 sprintf(vo_osd_text, "A-V delay: %d ms",(int)(audio_delay*1000)); | 2711 sprintf(osd_text_tmp, "A-V delay: %d ms",(int)(audio_delay*1000)); |
2711 osd_show_av_delay--; | 2712 osd_show_av_delay--; |
2712 } else | 2713 } else |
2713 sprintf(vo_osd_text,"%c %02d:%02d:%02d",osd_function,pts/3600,(pts/60)%60,pts%60); | 2714 sprintf(osd_text_tmp,"%c %02d:%02d:%02d",osd_function,pts/3600,(pts/60)%60,pts%60); |
2715 | |
2716 if(strcmp(vo_osd_text, osd_text_tmp)) { | |
2717 strcpy(vo_osd_text, osd_text_tmp); | |
2718 vo_osd_changed(1); | |
2719 } | |
2714 } else { | 2720 } else { |
2721 if(vo_osd_text) { | |
2715 vo_osd_text=NULL; | 2722 vo_osd_text=NULL; |
2723 vo_osd_changed(1); | |
2724 } | |
2716 } | 2725 } |
2717 // for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0; | 2726 // for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0; |
2718 // vo_osd_text=osd_text_buffer; | 2727 // vo_osd_text=osd_text_buffer; |
2719 #endif | 2728 #endif |
2720 | 2729 |
2735 | 2744 |
2736 // VobSub subtitles | 2745 // VobSub subtitles |
2737 if(vo_vobsub){ | 2746 if(vo_vobsub){ |
2738 current_module="vobsub"; | 2747 current_module="vobsub"; |
2739 vobsub_process(vo_vobsub,d_video->pts); | 2748 vobsub_process(vo_vobsub,d_video->pts); |
2749 | |
2750 /* Don't know how to detect wether the sub has changed or not */ | |
2751 vo_osd_changed(1); | |
2740 current_module=NULL; | 2752 current_module=NULL; |
2741 } | 2753 } |
2742 | 2754 |
2743 #ifdef USE_DVDREAD | 2755 #ifdef USE_DVDREAD |
2744 // DVD sub: | 2756 // DVD sub: |
2758 while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){ | 2770 while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){ |
2759 mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",len,d_video->pts,d_dvdsub->pts); | 2771 mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",len,d_video->pts,d_dvdsub->pts); |
2760 spudec_assemble(vo_spudec,packet,len,100*d_dvdsub->pts); | 2772 spudec_assemble(vo_spudec,packet,len,100*d_dvdsub->pts); |
2761 } | 2773 } |
2762 spudec_heartbeat(vo_spudec,100*d_video->pts); | 2774 spudec_heartbeat(vo_spudec,100*d_video->pts); |
2775 | |
2776 /* Don't know how to detect wether the sub has changed or not */ | |
2777 vo_osd_changed(1); | |
2763 current_module=NULL; | 2778 current_module=NULL; |
2764 } | 2779 } |
2765 #endif | 2780 #endif |
2766 | 2781 |
2767 } // while(!eof) | 2782 } // while(!eof) |