[Mplayer-cvslog] CVS: main/libmpdemux video.c,1.3,1.4 demux_viv.c,1.17,1.18

Arpi of Ize arpi at mplayer.dev.hu
Sun Dec 16 15:51:12 CET 2001


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

Modified Files:
	video.c demux_viv.c 
Log Message:
vivo A-V sync fixed

Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- video.c	8 Dec 2001 03:21:59 -0000	1.3
+++ video.c	16 Dec 2001 14:51:04 -0000	1.4
@@ -237,6 +237,12 @@
     if(demuxer->file_format==DEMUXER_TYPE_MOV && !force_fps){
         // .MOV files has no fixed FPS - just frame durations!
 	frame_time=d_video->pts-pts1;
+    } else
+    if(demuxer->file_format==DEMUXER_TYPE_VIVO && !force_fps){
+        // .VIVO files has no fixed FPS - just frame durations!
+	if(d_video->pts-pts1>0)
+	    frame_time=d_video->pts-pts1;
+	mp_msg(MSGT_CPLAYER,MSGL_V,"vivo frame_time=%5.3f   \n",frame_time);
     }
 
     if(demuxer->file_format==DEMUXER_TYPE_MPEG_PS) d_video->pts+=frame_time;

Index: demux_viv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_viv.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- demux_viv.c	15 Dec 2001 16:49:45 -0000	1.17
+++ demux_viv.c	16 Dec 2001 14:51:04 -0000	1.18
@@ -290,6 +290,9 @@
 return 1;
 }
 
+static audio_pos=0;
+static audio_rate=0;
+
 // return value:
 //     0 = EOF or no stream found
 //     1 = successfully read a packet
@@ -348,6 +351,7 @@
       else
         len=40;	/* 40kbps */
       ds=demux->audio;
+      audio_pos+=len;
       break;
   case 0x40:  // audio packet
       if (prefix == 1)
@@ -355,6 +359,7 @@
       else
         len=24;	/* 24kbps */
       ds=demux->audio;
+      audio_pos+=len;
       break;
   default:
       mp_msg(MSGT_DEMUX,MSGL_WARN,"VIVO - unknown ID found: %02X at pos %lu contact author!\n",
@@ -395,7 +400,7 @@
       dp=new_demux_packet(len);
       //memcpy(dp->buffer,data,len);
       stream_read(demux->stream,dp->buffer,len);
-//      dp->pts=time*0.001f;
+      dp->pts=audio_rate?((float)audio_pos/(float)audio_rate):0;
 //      dp->flags=keyframe;
 //      if(ds==demux->video) printf("ASF time: %8d  dur: %5d  \n",time,dur);
       dp->pos=demux->filepos;
@@ -545,6 +550,8 @@
     mp_msg(MSGT_DEMUX,MSGL_ERR,"VIVO: " MSGTR_MissingVideoStreamBug);
     return;
   }
+
+    audio_pos=0;
   
   h263_decode_picture_header(demuxer->video->buffer);
   
@@ -693,6 +700,7 @@
 		}
 		if (vivo_param_abitrate != -1)
 		    sh->wf->nAvgBytesPerSec = vivo_param_abitrate;
+		audio_rate=sh->wf->nAvgBytesPerSec;
 
 		if (!priv->audio_bytesperblock)
 		{




More information about the MPlayer-cvslog mailing list