[MPlayer-cvslog] CVS: main/libmpdemux muxer_mpeg.c,1.12,1.13

Nico Sabbi CVS syncmail at mplayerhq.hu
Thu Mar 3 08:48:56 CET 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv25407

Modified Files:
	muxer_mpeg.c 
Log Message:
recalculate frame duration after soft telecine

Index: muxer_mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_mpeg.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- muxer_mpeg.c	1 Mar 2005 21:04:09 -0000	1.12
+++ muxer_mpeg.c	3 Mar 2005 07:48:54 -0000	1.13
@@ -1821,6 +1821,7 @@
 			return 0;
 		}
 		*fps_ptr = (*fps_ptr & 0xf0) | (fps + 3);
+		vpriv->nom_delta_pts = parse_fps((fps + 3) == FRAMERATE_2997 ? 299700 : 300000);
 	}
 	
 	//in pce_ptr starting from bit 0 bit 24 is tff, bit 30 is rff, 
@@ -1831,6 +1832,8 @@
 		return 0;
 	}
 
+	vpriv->picture.progressive_sequence = 0;
+	vpriv->picture.progressive_frame = 1;
 	if(se_ptr)
 		se_ptr[1] &= 0xf7;
 	
@@ -1936,6 +1939,21 @@
 			temp_ref = (s->buffer[ptr+4]<<2)+(s->buffer[ptr+5]>>6);
 			if(!spriv->vframes)
 				spriv->last_tr = spriv->max_tr = temp_ref;
+			d1 = temp_ref - spriv->last_tr;
+			if(d1 < -6)	//there's a wraparound
+				frames_diff = spriv->max_tr + 1 + temp_ref - spriv->last_tr;
+			else if(d1 > 6)	//there's a wraparound
+				frames_diff = spriv->max_tr + 1 + spriv->last_tr - temp_ref;
+			else
+				frames_diff = d1;
+			mp_msg(MSGT_MUXER, MSGL_V, "\nLAST: %d, TR: %d, DIFF: %d, MAX: %d, d1: %d\n", 
+			spriv->last_tr, temp_ref, frames_diff, spriv->max_tr, d1);
+			if(!temp_ref)
+				spriv->max_tr = 0;
+			else if(temp_ref > spriv->max_tr)
+				spriv->max_tr = temp_ref;
+			
+			spriv->last_tr = temp_ref;
 			mp_msg(MSGT_MUXER, MSGL_V, "Video frame type: %c, TR: %d\n", FTYPE(pt), temp_ref);
 			if(spriv->picture.mpeg1 == 0) 
 			{
@@ -1947,6 +1965,8 @@
 				if(ptr < len-5) 
 				{
 					pce_ptr = &(s->buffer[ptr+4]);
+					if(spriv->telecine)
+						soft_telecine(spriv, fps_ptr, se_ptr, pce_ptr, frames_diff);
 					mp_header_process_extension(&(spriv->picture), &(s->buffer[ptr+4]));
 					if(spriv->picture.display_time >= 50 && spriv->picture.display_time <= 300) 
 						spriv->delta_pts = (spriv->nom_delta_pts * spriv->picture.display_time) / 100;
@@ -1956,22 +1976,6 @@
 			
 				ptr = tmp;
 			}
-			
-			d1 = temp_ref - spriv->last_tr;
-			if(d1 < -6)	//there's a wraparound
-				frames_diff = spriv->max_tr + 1 + temp_ref - spriv->last_tr;
-			else if(d1 > 6)	//there's a wraparound
-				frames_diff = spriv->max_tr + 1 + spriv->last_tr - temp_ref;
-			else
-				frames_diff = d1;
-			mp_msg(MSGT_MUXER, MSGL_V, "\nLAST: %d, TR: %d, DIFF: %d, MAX: %d, d1: %d\n", 
-			spriv->last_tr, temp_ref, frames_diff, spriv->max_tr, d1);
-			if(!temp_ref)
-				spriv->max_tr = 0;
-			else if(temp_ref > spriv->max_tr)
-				spriv->max_tr = temp_ref;
-			
-			spriv->last_tr = temp_ref;
 		}
 		
 		switch (pt) {
@@ -1997,9 +2001,6 @@
 			  sz = len; // no extra buffer for it...
 		}
 
-		if(spriv->telecine)
-			soft_telecine(spriv, fps_ptr, se_ptr, pce_ptr, frames_diff);
-
 		spriv->vframes++;
 		reorder_frame(spriv, s->buffer, len, pt, temp_ref, spriv->delta_pts);
 	}




More information about the MPlayer-cvslog mailing list