comparison utils.c @ 5943:57789f5d12cf libavformat

Dont try to compute AVPacket duration for possibly interlaced video codecs when no parser is available. This partly fixes the frame rate misdetection in issue1756.
author michael
date Fri, 09 Apr 2010 22:39:39 +0000
parents bde9a4b67f86
children 88cce1b69115
comparison
equal deleted inserted replaced
5942:b106b59bf663 5943:57789f5d12cf
737 *pnum = st->codec->time_base.num; 737 *pnum = st->codec->time_base.num;
738 *pden = st->codec->time_base.den; 738 *pden = st->codec->time_base.den;
739 if (pc && pc->repeat_pict) { 739 if (pc && pc->repeat_pict) {
740 *pnum = (*pnum) * (1 + pc->repeat_pict); 740 *pnum = (*pnum) * (1 + pc->repeat_pict);
741 } 741 }
742 //If this codec can be interlaced or progressive then we need a parser to compute duration of a packet
743 //Thus if we have no parser in such case leave duration undefined.
744 if(st->codec->ticks_per_frame>1 && !pc){
745 *pnum = *pden = 0;
746 }
742 } 747 }
743 break; 748 break;
744 case AVMEDIA_TYPE_AUDIO: 749 case AVMEDIA_TYPE_AUDIO:
745 frame_size = get_audio_frame_size(st->codec, pkt->size); 750 frame_size = get_audio_frame_size(st->codec, pkt->size);
746 if (frame_size < 0) 751 if (frame_size < 0)