[Ffmpeg-cvslog] r6544 - trunk/libavformat/utils.c

michael subversion
Tue Oct 3 21:13:28 CEST 2006


Author: michael
Date: Tue Oct  3 21:13:27 2006
New Revision: 6544

Modified:
   trunk/libavformat/utils.c

Log:
fix r_frame_rate detection in mpeg4 streams with non integer fps


Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Tue Oct  3 21:13:27 2006
@@ -1961,10 +1961,15 @@
                 }
             }
 
-            /* if no real frame rate, use the codec one */
             if (!st->r_frame_rate.num){
-                st->r_frame_rate.num = st->codec->time_base.den;
-                st->r_frame_rate.den = st->codec->time_base.num;
+                if(    st->codec->time_base.den * (int64_t)st->time_base.num
+                    <= st->codec->time_base.num * (int64_t)st->time_base.den){
+                    st->r_frame_rate.num = st->codec->time_base.den;
+                    st->r_frame_rate.den = st->codec->time_base.num;
+                }else{
+                    st->r_frame_rate.num = st->time_base.den;
+                    st->r_frame_rate.den = st->time_base.num;
+                }
             }
         }
     }




More information about the ffmpeg-cvslog mailing list