[Mplayer-cvslog] CVS: main mplayer.c,1.247,1.248 demux_mpg.c,1.30,1.31

Arpi of Ize arpi at mplayer.dev.hu
Tue Aug 28 23:35:16 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv32516

Modified Files:
	mplayer.c demux_mpg.c 
Log Message:
gui seekbar position fixed

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -r1.247 -r1.248
--- mplayer.c	28 Aug 2001 15:56:53 -0000	1.247
+++ mplayer.c	28 Aug 2001 21:35:04 -0000	1.248
@@ -1742,9 +1742,15 @@
 
 #ifdef HAVE_NEW_GUI
       if(use_gui){
-        int len=((demuxer->movi_end-demuxer->movi_start));
-	if ( len > 0 ) mplShMem->Position=(float)(demuxer->filepos-demuxer->movi_start) / len * 100.0f;
-	 else mplShMem->Position=0;
+	if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){
+	  // get pos from frame number / total frames
+	  mplShMem->Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
+	} else {
+	  // get pos from file position / filesize
+          int len=((demuxer->movi_end-demuxer->movi_start));
+	  int pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos;
+	  mplShMem->Position=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f);
+	}
 	mplShMem->TimeSec=d_video->pts; 
       }
 #endif

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_mpg.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- demux_mpg.c	22 Aug 2001 19:03:15 -0000	1.30
+++ demux_mpg.c	28 Aug 2001 21:35:04 -0000	1.31
@@ -234,7 +234,7 @@
 		    mp_msg(MSGT_DEMUX,MSGL_WARN,"Encrypted stream but authentication was not requested by you!!\n");
     }
 #endif
-    ds_read_packet(ds,demux->stream,len,pts/90000.0f,0,0);
+    ds_read_packet(ds,demux->stream,len,pts/90000.0f,demux->filepos,0);
 //    if(ds==demux->sub) parse_dvdsub(ds->last->buffer,ds->last->len);
     return 1;
   }
@@ -252,7 +252,7 @@
   // Elementary video stream
   if(demux->stream->eof) return 0;
   demux->filepos=stream_tell(demux->stream);
-  ds_read_packet(demux->video,demux->stream,STREAM_BUFFER_SIZE,0,0,0);
+  ds_read_packet(demux->video,demux->stream,STREAM_BUFFER_SIZE,0,demux->filepos,0);
   return 1;
 }
 




More information about the MPlayer-cvslog mailing list