[MPlayer-cvslog] r30298 - trunk/libmpdemux/demux_ts.c

cehoyos subversion at mplayerhq.hu
Wed Jan 13 00:03:03 CET 2010


Author: cehoyos
Date: Wed Jan 13 00:03:03 2010
New Revision: 30298

Log:
Use double instead of float for pts.

Patch by Dan Oscarsson, Dan D Oscarsson A tieto D com

Modified:
   trunk/libmpdemux/demux_ts.c

Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c	Tue Jan 12 23:21:21 2010	(r30297)
+++ trunk/libmpdemux/demux_ts.c	Wed Jan 13 00:03:03 2010	(r30298)
@@ -97,7 +97,7 @@ typedef struct {
 	unsigned char *start;
 	uint16_t payload_size;
 	es_stream_type_t type, subtype;
-	float pts, last_pts;
+	double pts, last_pts;
 	int pid;
 	char lang[4];
 	int last_cc;				// last cc code (-1 if first packet)
@@ -219,8 +219,8 @@ typedef struct {
 typedef struct {
 	uint64_t size;
 	float duration;
-	float first_pts;
-	float last_pts;
+	double first_pts;
+	double last_pts;
 } TS_stream_info;
 
 typedef struct {
@@ -1255,7 +1255,7 @@ static int mp4_parse_sl_packet(pmt_t *pm
 					return -1;
 			}
 
-			pes_es->pts = (float) v / (float) sl->ts_resolution;
+			pes_es->pts = (double) v / (double) sl->ts_resolution;
 			mp_msg(MSGT_DEMUXER,MSGL_DBG2, "CTS: %d bits, value: %"PRIu64"/%d = %.3f\n", sl->ts_len, v, sl->ts_resolution, pes_es->pts);
 		}
 
@@ -1398,7 +1398,7 @@ static int pes_parse2(unsigned char *buf
 		pts |=  p[12]         <<  7 ;
 		pts |= (p[13] & 0xFE) >>  1 ;
 
-		es->pts = pts / 90000.0f;
+		es->pts = pts / (double)90000.0f;
 	}
 	else
 		es->pts = 0.0f;
@@ -3277,8 +3277,8 @@ static void demux_seek_ts(demuxer_t *dem
 	{
 		if(sh_audio && !d_audio->eof && d_video->pts && d_audio->pts)
 		{
-			float a_pts=d_audio->pts;
-			a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
+			double a_pts=d_audio->pts;
+			a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(double)sh_audio->i_bps;
 			if(d_video->pts > a_pts)
 			{
 				skip_audio_frame(sh_audio);  // sync audio


More information about the MPlayer-cvslog mailing list