# HG changeset patch # User nicodvb # Date 1145565489 0 # Node ID 1b4bf0c9ecb39d31bb339646ed82245c6fe1f228 # Parent 516d7874450b57c0304196212d6013e3dc3cc6a4 simplified code to patch the video framerate (removed silly comparisons) diff -r 516d7874450b -r 1b4bf0c9ecb3 libmpdemux/muxer_mpeg.c --- a/libmpdemux/muxer_mpeg.c Thu Apr 20 20:32:36 2006 +0000 +++ b/libmpdemux/muxer_mpeg.c Thu Apr 20 20:38:09 2006 +0000 @@ -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); } }