aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-05-06 20:26:50 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-05-06 20:26:50 +0000
commit327c4076a3eec0c0f48190e319dfe466c4e0bb8a (patch)
tree1643ec8a785c7481671b11350cfdc1b2f13ee2d2 /libavformat/utils.c
parentb712fb67402caba158eb507a3e32fbe067ed139c (diff)
downloadffmpeg-327c4076a3eec0c0f48190e319dfe466c4e0bb8a.tar.gz
prefer container time_base for frame duration guess
Originally committed as revision 4190 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 50cde39a61..21fd82528c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -632,16 +632,16 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
*pden = 0;
switch(st->codec.codec_type) {
case CODEC_TYPE_VIDEO:
- if(st->codec.time_base.num*1000 <= st->codec.time_base.den){
+ if(st->time_base.num*1000 > st->time_base.den){
*pnum = st->time_base.num;
*pden = st->time_base.den;
- }else{
+ }else if(st->codec.time_base.num*1000 > st->codec.time_base.den){
*pnum = st->codec.time_base.num;
*pden = st->codec.time_base.den;
- }
- if (pc && pc->repeat_pict) {
- *pden *= 2;
- *pnum = (*pnum) * (2 + pc->repeat_pict);
+ if (pc && pc->repeat_pict) {
+ *pden *= 2;
+ *pnum = (*pnum) * (2 + pc->repeat_pict);
+ }
}
break;
case CODEC_TYPE_AUDIO: