mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-28 23:02:07 +00:00
Allow larger denominators for IVF movies
This commit is contained in:
parent
6f7eededfb
commit
f12bf069f0
1 changed files with 10 additions and 6 deletions
|
@ -325,8 +325,7 @@ class VpxPlayer : public MoviePlayer
|
||||||
vpx_codec_ctx_t codec{};
|
vpx_codec_ctx_t codec{};
|
||||||
vpx_codec_iter_t iter = nullptr;
|
vpx_codec_iter_t iter = nullptr;
|
||||||
|
|
||||||
uint32_t convnumer;
|
double convrate;
|
||||||
uint32_t convdenom;
|
|
||||||
|
|
||||||
uint64_t nsecsperframe;
|
uint64_t nsecsperframe;
|
||||||
uint64_t nextframetime;
|
uint64_t nextframetime;
|
||||||
|
@ -398,15 +397,20 @@ public:
|
||||||
if (numframes == 0) return false;
|
if (numframes == 0) return false;
|
||||||
fr.Seek(4, FileReader::SeekCur);
|
fr.Seek(4, FileReader::SeekCur);
|
||||||
|
|
||||||
if (fpsdenominator > 1000 || fpsnumerator == 0 || fpsdenominator == 0)
|
if (fpsnumerator == 0 || fpsdenominator == 0)
|
||||||
{
|
{
|
||||||
// default to 30 fps if the header does not provide useful info.
|
// default to 30 fps if the header does not provide useful info.
|
||||||
fpsdenominator = 30;
|
fpsdenominator = 30;
|
||||||
fpsnumerator = 1;
|
fpsnumerator = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
convnumer = 120 * fpsnumerator;
|
if (origframedelay < 1)
|
||||||
convdenom = fpsdenominator * origframedelay;
|
convrate = 0.0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
convrate = 120.0 * double(fpsnumerator);
|
||||||
|
convrate /= double(fpsdenominator) * double(origframedelay);
|
||||||
|
}
|
||||||
|
|
||||||
nsecsperframe = int64_t(fpsnumerator) * 1'000'000'000 / fpsdenominator;
|
nsecsperframe = int64_t(fpsnumerator) * 1'000'000'000 / fpsdenominator;
|
||||||
nextframetime = 0;
|
nextframetime = 0;
|
||||||
|
@ -577,7 +581,7 @@ public:
|
||||||
if (framenum >= numframes) stop = true;
|
if (framenum >= numframes) stop = true;
|
||||||
|
|
||||||
bool nostopsound = (flags & NOSOUNDCUTOFF);
|
bool nostopsound = (flags & NOSOUNDCUTOFF);
|
||||||
int soundframe = convdenom ? Scale(framenum, convnumer, convdenom) : framenum;
|
int soundframe = (convrate > 0.0) ? int(convrate * framenum) : framenum;
|
||||||
if (soundframe > lastsoundframe)
|
if (soundframe > lastsoundframe)
|
||||||
{
|
{
|
||||||
if (soundtrack == -1)
|
if (soundtrack == -1)
|
||||||
|
|
Loading…
Reference in a new issue