[Mplayer-cvslog] CVS: main/libmpdemux demux_fli.c,1.6,1.7 demuxer.c,1.55,1.56

Arpi of Ize arpi at mplayer.dev.hu
Mon Dec 17 01:24:06 CET 2001


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

Modified Files:
	demux_fli.c demuxer.c 
Log Message:
fli seeking implemented

Index: demux_fli.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_fli.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- demux_fli.c	9 Dec 2001 16:21:32 -0000	1.6
+++ demux_fli.c	17 Dec 2001 00:24:03 -0000	1.7
@@ -22,6 +22,22 @@
   unsigned int *frame_size;
 } fli_frames_t;
 
+void demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags){
+  fli_frames_t *frames = (fli_frames_t *)demuxer->priv;
+  sh_video_t *sh_video = demuxer->video->sh;
+  int newpos=(flags&1)?0:frames->current_frame;
+  if(flags&2){
+      // float 0..1
+      newpos+=rel_seek_secs*frames->num_frames;
+  } else {
+      // secs
+      newpos+=rel_seek_secs*sh_video->fps;
+  }
+  if(newpos<0) newpos=0; else
+  if(newpos>frames->num_frames) newpos=frames->num_frames;
+  frames->current_frame=newpos;
+}
+
 // return value:
 //     0 = EOF or no stream found
 //     1 = successfully read a packet
@@ -30,7 +46,7 @@
   sh_video_t *sh_video = demuxer->video->sh;
 
   // see if the end has been reached
-  if (frames->current_frame == frames->num_frames)
+  if (frames->current_frame >= frames->num_frames)
     return 0;
 
   // fetch the frame from the file

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- demuxer.c	17 Dec 2001 00:03:50 -0000	1.55
+++ demuxer.c	17 Dec 2001 00:24:03 -0000	1.56
@@ -595,6 +595,7 @@
 int demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags);
+int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags);
 void demux_seek_mov(demuxer_t *demuxer,float pts,int flags);
 
 int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
@@ -640,6 +641,9 @@
 
   case DEMUXER_TYPE_MOV:
       demux_seek_mov(demuxer,rel_seek_secs,flags);  break;
+
+  case DEMUXER_TYPE_FLI:
+      demux_seek_fli(demuxer,rel_seek_secs,flags);  break;
 
 } // switch(demuxer->file_format)
 




More information about the MPlayer-cvslog mailing list