changeset 22018:89fcce32d9d0

Call real_fix_timestamp() after seeking, to avoid video freezing because of wrong timestamps. Fixes seek_sample2.rmvb and others. Patch by LR ))) hephooey ))(( gmail )( com (((
author rtogni
date Sat, 27 Jan 2007 22:34:27 +0000
parents 0421ee482f38
children f43d02e9b58b
files libmpdemux/demux_real.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_real.c	Sat Jan 27 17:01:54 2007 +0000
+++ b/libmpdemux/demux_real.c	Sat Jan 27 22:34:27 2007 +0000
@@ -926,9 +926,10 @@
 			// this fragment is for new packet, close the old one
 			mp_msg(MSGT_DEMUX,MSGL_DBG2, "closing probably incomplete packet, len: %d  \n",dp->len);
 			if(priv->video_after_seek){
-			    dp->pts=timestamp;
 				priv->kf_base = 0;
 				priv->kf_pts = dp_hdr->timestamp;
+				dp->pts=
+				real_fix_timestamp(priv,dp_data,dp_hdr->timestamp,sh_video->frametime,sh_video->format);
 				priv->video_after_seek = 0;
 			} else if (dp_hdr->len >= 3)
 			    dp->pts =
@@ -963,9 +964,10 @@
  			    mp_dbg(MSGT_DEMUX,MSGL_DBG2, "fragment (%d bytes) appended, %d bytes left\n",vpkg_offset,len);
 			    // we know that this is the last fragment -> we can close the packet!
 			    if(priv->video_after_seek){
-			        dp->pts=timestamp;
 				    priv->kf_base = 0;
 				    priv->kf_pts = dp_hdr->timestamp;
+				    dp->pts=
+				    real_fix_timestamp(priv,dp_data,dp_hdr->timestamp,sh_video->frametime,sh_video->format);
 				    priv->video_after_seek = 0;
 			    } else if (dp_hdr->len >= 3)
 				dp->pts =
@@ -1004,6 +1006,13 @@
 		    stream_read(demuxer->stream, dp_data, len);
 		    ds->asf_packet=dp;
 		    len=0;
+		    if(priv->video_after_seek){
+		        priv->kf_base = 0;
+		        priv->kf_pts = dp_hdr->timestamp;
+		        dp->pts=
+		        real_fix_timestamp(priv,dp_data,dp_hdr->timestamp,sh_video->frametime,sh_video->format);
+		        priv->video_after_seek = 0;
+		    }
 		    break;
 		}
 		// whole packet (not fragmented):
@@ -1019,9 +1028,10 @@
 		dp_hdr->len=vpkg_length; len-=vpkg_length;
 		stream_read(demuxer->stream, dp_data, vpkg_length);
 		if(priv->video_after_seek){
-		    dp->pts=timestamp;
 			priv->kf_base = 0;
 			priv->kf_pts = dp_hdr->timestamp;
+			dp->pts=
+			real_fix_timestamp(priv,dp_data,dp_hdr->timestamp,sh_video->frametime,sh_video->format);
 			priv->video_after_seek = 0;
 		} else if (dp_hdr->len >= 3)
 		    dp->pts =