Fix retrieving the frame rate for real. Apparently
it can be any of these values, hope the priority is right. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38659 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
31879da81c
commit
2baccbd9fb
@ -740,7 +740,15 @@ AVFormatReader::StreamCookie::FrameRate() const
|
||||
frameRate = (double)fStream->codec->sample_rate;
|
||||
break;
|
||||
case CODEC_TYPE_VIDEO:
|
||||
frameRate = av_q2d(fStream->avg_frame_rate);
|
||||
if (fStream->avg_frame_rate.den && fStream->avg_frame_rate.num)
|
||||
frameRate = av_q2d(fStream->avg_frame_rate);
|
||||
else if (fStream->r_frame_rate.den && fStream->r_frame_rate.num)
|
||||
frameRate = av_q2d(fStream->r_frame_rate);
|
||||
else if (fStream->time_base.den && fStream->time_base.num)
|
||||
frameRate = 1 / av_q2d(fStream->time_base);
|
||||
else if (fStream->codec->time_base.den && fStream->codec->time_base.num)
|
||||
frameRate = 1 / av_q2d(fStream->codec->time_base);
|
||||
|
||||
// TODO: Fix up interlaced video for real
|
||||
if (frameRate == 50.0f)
|
||||
frameRate = 25.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user