Ian Robinson wrote: ↑Sat Oct 28, 2023 7:39 pm
I be looking at your update very soon to see if we can solve the it cant play more then 18 mins on hardware. It's playing right thru on demul dcemulator another one of those times.. after 18 mins it gets super slow for a while then freezes crashes.. Problem was time to make a change and test 18 mins of wear on the gdrom drive each time.. Prolly need to setup up my gdemu again as doing this for days and hours at time is bit much..
I was able to play a 43 minute video with the last version, Ver0.9.
I can't be sure, but it may be a problem with the accuracy of timer_ms_gettime64().
In the first version, frame rate control was as follows.
Code: Select all
float start_time = (float)timer_ms_gettime64() / 1000.0;
float playing_time = 0.0f;
float frame_time = 1.0f / (float)plm_get_framerate(plm);
...
...
/* Decode */
playing_time = ((float)timer_ms_gettime64() / 1000.0) - start_time;
if ((frame->time - playing_time) < frame_time)
{
frame = plm_decode_video(plm);
if (!frame)
break;
decoded = 1;
}
The last version does not use timer_ms_gettime64().
I'm just comparing the decoded video and audio times. Therefore, the frame rate may not be uniform.
Code: Select all
sample = plm_decode_audio(plm);
if (sample == NULL)
{
audio_time += audio_interval;
break;
}
audio_time = sample->time;
...
...
audio_interval = audio_time;
...
...
/* Decode */
if ((audio_time - audio_interval) >= frame->time)
{
frame = plm_decode_video(plm);
if (!frame)
break;
decoded = 1;
}
But there's a new problem. As the loading time changes for long videos, we found that there was a difference from the audio_interval that was set at the beginning, causing audio lag.
Also, it didn't come back even after the video ended. I need to fix the termination process.