[MPlayer-cvslog] r21039 - trunk/libmpdemux/demux_nut.c

ods15 subversion at mplayerhq.hu
Sat Nov 18 21:44:22 CET 2006


Author: ods15
Date: Sat Nov 18 21:44:22 2006
New Revision: 21039

Modified:
   trunk/libmpdemux/demux_nut.c

Log:
fix demux_nut to give proper (estimate) of percent position after a seek


Modified: trunk/libmpdemux/demux_nut.c
==============================================================================
--- trunk/libmpdemux/demux_nut.c	(original)
+++ trunk/libmpdemux/demux_nut.c	Sat Nov 18 21:44:22 2006
@@ -260,8 +260,10 @@
 		                       priv->s[0].time_base.den;
 
 	while ((ret = nut_seek(nut, time_pos, nutflags, tmp)) == NUT_ERR_EAGAIN);
+	priv->last_pts = -1;
 	if (ret) mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(ret));
 	if (sh_audio) resync_audio_stream(sh_audio);
+	demuxer->filepos = stream_tell(demuxer->stream);
 }
 
 static int demux_control_nut(demuxer_t * demuxer, int cmd, void * arg) {
@@ -273,7 +275,7 @@
 				        priv->s[0].time_base.den;
 			return DEMUXER_CTRL_OK;
 		case DEMUXER_CTRL_GET_PERCENT_POS:
-			if (priv->s[0].max_pts == 0)
+			if (priv->s[0].max_pts == 0 || priv->last_pts == -1)
 				return DEMUXER_CTRL_DONTKNOW;
 			*((int *)arg) = priv->last_pts * 100 /
 			                (double)priv->s[0].max_pts;



More information about the MPlayer-cvslog mailing list