[Mplayer-cvslog] CVS: main/libmpdemux demux_rawvideo.c,1.2,1.3

Alban Bedel CVS albeu at mplayerhq.hu
Thu Mar 27 21:30:47 CET 2003


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

Modified Files:
	demux_rawvideo.c 
Log Message:
on now set the demuxer type some we can use rawvideo with -audiofile
Add the pts, it was always 0 :(
Switch to the new config header


Index: demux_rawvideo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_rawvideo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demux_rawvideo.c	23 Jan 2003 01:16:49 -0000	1.2
+++ demux_rawvideo.c	27 Mar 2003 20:30:44 -0000	1.3
@@ -6,7 +6,8 @@
 #include <unistd.h>
 #include <string.h>
 
-#include "../cfgparser.h"
+#include "../m_option.h"
+#include "../m_config.h"
 
 #include "stream.h"
 #include "demuxer.h"
@@ -14,7 +15,7 @@
 
 #include "../libmpcodecs/img_format.h"
 
-int use_rawvideo = 0;
+extern int demuxer_type;
 static int format = IMGFMT_I420;
 static int size_id = 0;
 static int width = 0;
@@ -23,7 +24,7 @@
 static int imgsize=0;
 
 config_t demux_rawvideo_opts[] = {
-  { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL },
+  { "on", &demuxer_type, CONF_TYPE_FLAG, 0,0, DEMUXER_TYPE_RAWVIDEO, NULL },
   // size:
   { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL },
   { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL },
@@ -99,12 +100,12 @@
 }
 
 int demux_rawvideo_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) {
-
+  sh_video_t* sh = demuxer->video->sh;
+  off_t pos;
   if(demuxer->stream->eof) return 0;
   if(ds!=demuxer->video) return 0;
-
-  ds_read_packet(ds,demuxer->stream,imgsize,0,stream_tell(demuxer->stream),0x10);
-
+  pos = stream_tell(demuxer->stream);
+  ds_read_packet(ds,demuxer->stream,imgsize,(pos/imgsize)*sh->frametime,pos,0x10);
   return 1;
 }
 
@@ -118,9 +119,11 @@
     pos += ((demuxer->movi_end - demuxer->movi_start)*rel_seek_secs);
   else
     pos += (rel_seek_secs*sh_video->i_bps);
-
+  if(pos < 0) pos = 0;
+  if(demuxer->movi_end && pos > demuxer->movi_end) pos = (demuxer->movi_end-imgsize);
   pos/=imgsize;
   stream_seek(s,pos*imgsize);
-  sh_video->timer=pos * sh_video->frametime;
+  //sh_video->timer=pos * sh_video->frametime;
+  demuxer->video->pts = pos * sh_video->frametime;
 //  printf("demux_rawvideo: streamtell=%d\n",(int)stream_tell(demuxer->stream));
 }



More information about the MPlayer-cvslog mailing list