[MPlayer-users] mpeg file seek bug!

ajing ajing99 at mails.tsinghua.edu.cn
Fri Apr 9 10:16:45 CEST 2004


When I play mpeg file with ¨Css option, the player always seeks to a wrong 
time position!

For example, if I execute:   mplayer ¨Css 30:00 test.mpg

The time position should seek to 30 minute, but in fact seek to wrong 
position!



And I also found the total time length of mpeg was displayed wrong!



I have checked the source code, maybe its a bug of file demux_mpg.c. 
(located in dir libmpdemux)






void demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags){

  ¡­

  //================= seek in MPEG ==========================

  ¡­

       // time seek (secs)

        if(!sh_video->i_bps) // unspecified or VBR

          newpos+=2324*75*rel_seek_secs; // 174.3 kbyte/sec

        else

          newpos+=sh_video->i_bps*rel_seek_secs;

                           ~~~~~~~~~~~maybe wrong!!!

   ...

int demux_mpg_control(demuxer_t *demuxer,int cmd, void *arg){
   ...

    switch(cmd) {
 case DEMUXER_CTRL_GET_TIME_LENGTH:
     if(!sh_video->i_bps)  // unspecified or VBR
      return DEMUXER_CTRL_DONTKNOW;
     *((unsigned long 
*)arg)=(demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;

                                                                             
                                    ~~~~~~~~~~~maybe wrong!!!



But I don't kown how to fix this bug : (






More information about the MPlayer-users mailing list