[MPlayer-cvslog] CVS: main/libmpdemux muxer_mpeg.c,1.44,1.45

Nico Sabbi CVS syncmail at mplayerhq.hu
Thu Apr 20 22:38:13 CEST 2006


CVS change done by Nico Sabbi CVS

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

Modified Files:
	muxer_mpeg.c 
Log Message:
simplified code to patch the video framerate (removed silly comparisons)

Index: muxer_mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_mpeg.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- muxer_mpeg.c	20 Apr 2006 20:32:36 -0000	1.44
+++ muxer_mpeg.c	20 Apr 2006 20:38:09 -0000	1.45
@@ -2733,33 +2733,35 @@
   {
 	int fps;
 	
-	fps = (int) (conf_vframerate * 1000.0);
+	fps = (int) (conf_vframerate * 1001 + 0.5);
 	switch(fps)
 	{
 		case 24000:
+			priv->vframerate = FRAMERATE_23976;
+			break;
+		case 24024:
 			priv->vframerate = FRAMERATE_24;
 			break;
-		case 25000:
+		case 25025:
 			priv->vframerate = FRAMERATE_25;
 			break;
 		case 30000:
+			priv->vframerate = FRAMERATE_2997;
+			break;
+		case 30030:
 			priv->vframerate = FRAMERATE_30;
 			break;
-		case 50000:
+		case 50050:
 			priv->vframerate = FRAMERATE_50;
 			break;
 		case 60000:
+			priv->vframerate = FRAMERATE_5994;
+			break;
+		case 60060:
 			priv->vframerate = FRAMERATE_60;
 			break;
 		default:
-			if(fps >= 23975 && fps <= 23977)
-				priv->vframerate = FRAMERATE_23976;
-			else if(fps >= 29969 && fps <= 29971)
-				priv->vframerate = FRAMERATE_2997;
-			else if(fps >= 59939 && fps <= 59941)
-				priv->vframerate = FRAMERATE_5994;
-			else
-				mp_msg(MSGT_MUXER, MSGL_ERR, "WRONG FPS: %d/1000, ignoring\n", fps);
+			mp_msg(MSGT_MUXER, MSGL_ERR, "WRONG FPS: %d/1000, ignoring\n", fps);
 	}
   }
   




More information about the MPlayer-cvslog mailing list