Mercurial > libavformat.hg
comparison utils.c @ 747:95c9cef3c3db libavformat
prefer container time_base for frame duration guess
| author | michael |
|---|---|
| date | Fri, 06 May 2005 20:26:50 +0000 |
| parents | af4e24d6310c |
| children | 6bd8b2955534 |
comparison
equal
deleted
inserted
replaced
| 746:5f07cc45fd50 | 747:95c9cef3c3db |
|---|---|
| 630 | 630 |
| 631 *pnum = 0; | 631 *pnum = 0; |
| 632 *pden = 0; | 632 *pden = 0; |
| 633 switch(st->codec.codec_type) { | 633 switch(st->codec.codec_type) { |
| 634 case CODEC_TYPE_VIDEO: | 634 case CODEC_TYPE_VIDEO: |
| 635 if(st->codec.time_base.num*1000 <= st->codec.time_base.den){ | 635 if(st->time_base.num*1000 > st->time_base.den){ |
| 636 *pnum = st->time_base.num; | 636 *pnum = st->time_base.num; |
| 637 *pden = st->time_base.den; | 637 *pden = st->time_base.den; |
| 638 }else{ | 638 }else if(st->codec.time_base.num*1000 > st->codec.time_base.den){ |
| 639 *pnum = st->codec.time_base.num; | 639 *pnum = st->codec.time_base.num; |
| 640 *pden = st->codec.time_base.den; | 640 *pden = st->codec.time_base.den; |
| 641 } | 641 if (pc && pc->repeat_pict) { |
| 642 if (pc && pc->repeat_pict) { | 642 *pden *= 2; |
| 643 *pden *= 2; | 643 *pnum = (*pnum) * (2 + pc->repeat_pict); |
| 644 *pnum = (*pnum) * (2 + pc->repeat_pict); | 644 } |
| 645 } | 645 } |
| 646 break; | 646 break; |
| 647 case CODEC_TYPE_AUDIO: | 647 case CODEC_TYPE_AUDIO: |
| 648 frame_size = get_audio_frame_size(&st->codec, pkt->size); | 648 frame_size = get_audio_frame_size(&st->codec, pkt->size); |
| 649 if (frame_size < 0) | 649 if (frame_size < 0) |
