[Mplayer-cvslog] CVS: main mplayer.c,1.28,1.29

GEREOFFY arpi_esp at users.sourceforge.net
Tue Mar 27 02:39:26 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv7876

Modified Files:
	mplayer.c 
Log Message:
OSD functionality improved

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** mplayer.c	2001/03/25 20:38:14	1.28
--- mplayer.c	2001/03/27 00:39:24	1.29
***************
*** 39,42 ****
--- 39,43 ----
  
  #include "libvo/video_out.h"
+ #include "libvo/sub.h"
  
  // CODECS:
***************
*** 465,468 ****
--- 466,472 ----
         vo_font=read_font_desc(font_name,font_factor);
         if(!vo_font) printf("Can't load font: %s\n",font_name);
+   } else {
+       // try default:
+        vo_font=read_font_desc(get_path("font/font.desc"),font_factor);
    }
  
***************
*** 1144,1147 ****
--- 1148,1153 ----
  int grab_frames=0;
  char osd_text_buffer[64];
+ int osd_visible=100;
+ int osd_function=OSD_PLAY;
  
  #ifdef HAVE_LIRC
***************
*** 1832,1836 ****
  
      if(eof) break;
!     if(force_redraw) --force_redraw;
  
  //    printf("A:%6.1f  V:%6.1f  A-V:%7.3f  frame=%5.2f   \r",d_audio->pts,d_video->pts,d_audio->pts-d_video->pts,a_frame);
--- 1838,1845 ----
  
      if(eof) break;
!     if(force_redraw){
!       --force_redraw;
!       if(!force_redraw) osd_function=OSD_PLAY;
!     }
  
  //    printf("A:%6.1f  V:%6.1f  A-V:%7.3f  frame=%5.2f   \r",d_audio->pts,d_video->pts,d_audio->pts-d_video->pts,a_frame);
***************
*** 1918,1929 ****
    ++frame_corr_num;
  #endif
- 
-   } //  while(v_frame<a_frame || force_redraw)
  
  
! //================= Update OSD ====================
  
- sprintf(osd_text_buffer,"%02d:%02d:%02d",(int)v_pts/3600,((int)v_pts/60)%60,((int)v_pts)%60);
- vo_osd_text=osd_text_buffer;
  
  //================= Keyboard events, SEEKing ====================
--- 1927,1938 ----
    ++frame_corr_num;
  #endif
  
+   if(osd_visible){
+     --osd_visible;
+     if(!osd_visible) vo_osd_progbar_type=-1; // disable
+   }
  
!   } //  while(v_frame<a_frame || force_redraw)
  
  
  //================= Keyboard events, SEEKing ====================
***************
*** 1938,1956 ****
      // seek 10 sec
      case KEY_RIGHT:
        rel_seek_secs+=10;break;
      case KEY_LEFT:
        rel_seek_secs-=10;break;
      // seek 1 min
      case KEY_UP:
        rel_seek_secs+=60;break;
      case KEY_DOWN:
        rel_seek_secs-=60;break;
      // delay correction:
      case '+':
!       buffer_delay+=0.1;  // increase audio buffer size
        a_frame-=0.1;
        break;
      case '-':
!       buffer_delay-=0.1;  // decrease audio buffer size
        a_frame+=0.1;
        break;
--- 1947,1969 ----
      // seek 10 sec
      case KEY_RIGHT:
+       osd_function=OSD_FFW;
        rel_seek_secs+=10;break;
      case KEY_LEFT:
+       osd_function=OSD_REW;
        rel_seek_secs-=10;break;
      // seek 1 min
      case KEY_UP:
+       osd_function=OSD_FFW;
        rel_seek_secs+=60;break;
      case KEY_DOWN:
+       osd_function=OSD_REW;
        rel_seek_secs-=60;break;
      // delay correction:
      case '+':
!       buffer_delay+=0.1;  // increase audio buffer delay
        a_frame-=0.1;
        break;
      case '-':
!       buffer_delay-=0.1;  // decrease audio buffer delay
        a_frame+=0.1;
        break;
***************
*** 1968,1971 ****
--- 1981,1985 ----
      case 'p':
      case ' ':
+       osd_function=OSD_PAUSE;
        printf("\n------ PAUSED -------\r");fflush(stdout);
        while(
***************
*** 1976,1979 ****
--- 1990,1994 ----
  	  video_out->check_events();
        }
+       osd_function=OSD_PLAY;
        break;
    }
***************
*** 2141,2144 ****
--- 2156,2166 ----
          skip_video_frames,skip_audio_bytes,skip_audio_secs);
  
+         // Set OSD:
+       osd_visible=default_fps;
+       vo_osd_progbar_type=0;
+       vo_osd_progbar_value=(demuxer->filepos)/((avi_header.movi_end-avi_header.movi_start)>>8);
+       printf("avi filepos = %d  \n",vo_osd_progbar_value);
+ //      printf("avi filepos = %d  (len=%d)  \n",demuxer->filepos,(avi_header.movi_end-avi_header.movi_start));
+ 
    }
    break;
***************
*** 2247,2252 ****
    }
  } // keyboard event handler
- 
  
  
  } // while(!eof)
--- 2269,2279 ----
    }
  } // keyboard event handler
  
+ //================= Update OSD ====================
+ { int i;
+   sprintf(osd_text_buffer,"%c %02d:%02d:%02d",osd_function,(int)v_pts/3600,((int)v_pts/60)%60,((int)v_pts)%60);
+ //  for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0;
+   vo_osd_text=osd_text_buffer;
+ }
  
  } // while(!eof)


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list