[Mplayer-cvslog] CVS: main mplayer.c,1.94,1.95 stream.h,1.2,1.3 stream.c,1.5,1.6 demuxer.c,1.5,1.6 vcd_read.c,1.2,1.3

GEREOFFY arpi_esp at users.sourceforge.net
Mon Apr 23 23:25:11 CEST 2001


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

Modified Files:
	mplayer.c stream.h stream.c demuxer.c vcd_read.c 
Log Message:
OSD seekbar fixed for mpeg/VCD

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -r1.94 -r1.95
*** mplayer.c	2001/04/23 19:20:44	1.94
--- mplayer.c	2001/04/23 21:25:09	1.95
***************
*** 365,369 ****
  int seek_to_byte=0;
  int f; // filedes
- int stream_type;
  stream_t* stream=NULL;
  int file_format=DEMUXER_TYPE_UNKNOWN;
--- 365,368 ----
***************
*** 519,538 ****
  if(vcd_track){
  //============ Open VideoCD track ==============
!   int ret;
    f=open(filename,O_RDONLY);
    if(f<0){ printf("CD-ROM Device '%s' not found!\n",filename);return 1; }
    vcd_read_toc(f);
    ret=vcd_seek_to_track(f,vcd_track);
    if(ret<0){ printf("Error selecting VCD track!\n");return 1;}
    seek_to_byte+=ret;
!   if(verbose) printf("VCD start byte position: 0x%X\n",seek_to_byte);
!   stream_type=STREAMTYPE_VCD;
  #ifdef VCD_CACHE
    vcd_cache_init(vcd_cache_size);
  #endif
  } else {
  //============ Open plain FILE ============
    f=open(filename,O_RDONLY);
    if(f<0){ printf("File not found: '%s'\n",filename);return 1; }
  #ifdef HAVE_LIBCSS
    if (dvdimportkey) {
--- 518,547 ----
  if(vcd_track){
  //============ Open VideoCD track ==============
!   int ret,ret2;
    f=open(filename,O_RDONLY);
    if(f<0){ printf("CD-ROM Device '%s' not found!\n",filename);return 1; }
    vcd_read_toc(f);
+   ret2=vcd_get_track_end(f,vcd_track);
+   if(ret2<0){ printf("Error selecting VCD track!\n");return 1;}
    ret=vcd_seek_to_track(f,vcd_track);
    if(ret<0){ printf("Error selecting VCD track!\n");return 1;}
    seek_to_byte+=ret;
!   if(verbose) printf("VCD start byte position: 0x%X  end: 0x%X\n",seek_to_byte,ret2);
  #ifdef VCD_CACHE
    vcd_cache_init(vcd_cache_size);
  #endif
+   stream=new_stream(f,STREAMTYPE_VCD);
+   stream->start_pos=ret;
+   stream->end_pos=ret2;
  } else {
  //============ Open plain FILE ============
+   int len;
    f=open(filename,O_RDONLY);
    if(f<0){ printf("File not found: '%s'\n",filename);return 1; }
+   len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);
+   stream=new_stream(f,STREAMTYPE_FILE);
+   stream->end_pos=len;
+ }
+ 
  #ifdef HAVE_LIBCSS
    if (dvdimportkey) {
***************
*** 548,555 ****
    }
  #endif
-   stream_type=STREAMTYPE_FILE;
- }
  
- stream=new_stream(f,stream_type);
  //============ Open & Sync stream and detect file format ===============
  
--- 557,561 ----
***************
*** 1897,1901 ****
            osd_visible=sh_video->fps; // 1 sec
            vo_osd_progbar_type=0;
!           vo_osd_progbar_value=(demuxer->filepos)/len;
          }
          //printf("avi filepos = %d  \n",vo_osd_progbar_value);
--- 1903,1907 ----
            osd_visible=sh_video->fps; // 1 sec
            vo_osd_progbar_type=0;
!           vo_osd_progbar_value=(demuxer->filepos-demuxer->movi_start)/len;
          }
          //printf("avi filepos = %d  \n",vo_osd_progbar_value);

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/stream.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** stream.h	2001/04/23 03:32:10	1.2
--- stream.h	2001/04/23 21:25:09	1.3
***************
*** 22,25 ****
--- 22,26 ----
    int type; // 0=file 1=VCD
    unsigned int buf_pos,buf_len;
+   long start_pos,end_pos;
    unsigned char buffer[STREAM_BUFFER_SIZE>VCD_SECTOR_SIZE?STREAM_BUFFER_SIZE:VCD_SECTOR_SIZE];
  } stream_t;

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/stream.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** stream.c	2001/04/22 16:56:20	1.5
--- stream.c	2001/04/23 21:25:09	1.6
***************
*** 106,109 ****
--- 106,110 ----
    s->type=type;
    s->buf_pos=s->buf_len=0;
+   s->start_pos=s->end_pos=0;
    stream_reset(s);
    return s;

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** demuxer.c	2001/04/23 03:42:17	1.5
--- demuxer.c	2001/04/23 21:25:09	1.6
***************
*** 36,39 ****
--- 36,41 ----
    memset(d,0,sizeof(demuxer_t));
    d->stream=stream;
+   d->movi_start=stream->start_pos;
+   d->movi_end=stream->end_pos;
    d->synced=0;
    d->filepos=0;

Index: vcd_read.c
===================================================================
RCS file: /cvsroot/mplayer/main/vcd_read.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** vcd_read.c	2001/04/23 03:42:17	1.2
--- vcd_read.c	2001/04/23 21:25:09	1.3
***************
*** 26,29 ****
--- 26,42 ----
  }
  
+ int vcd_get_track_end(int fd,int track){
+   struct cdrom_tochdr tochdr;
+   if (ioctl(fd,CDROMREADTOCHDR,&tochdr)==-1)
+     { perror("read CDROM toc header: "); return -1; }
+   vcd_entry.cdte_format = CDROM_MSF;
+   vcd_entry.cdte_track  = track<tochdr.cdth_trk1?(track+1):CDROM_LEADOUT;
+   if (ioctl(fd, CDROMREADTOCENTRY, &vcd_entry)) {
+     perror("ioctl dif2");
+     return -1;
+   }
+   return VCD_SECTOR_DATA*vcd_get_msf();
+ }
+ 
  void vcd_read_toc(int fd){
    struct cdrom_tochdr tochdr;


_______________________________________________
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