Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FNAMF: Fix video playback speed and audio buffer starvation #7

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

redmcg
Copy link

@redmcg redmcg commented May 31, 2024

This PR addresses two issues:

  1. Video playback playing at double speed; and
  2. Audio buffer starvation due to the samples provided by MF being significantly smaller than the requested buffer size

The doubled video playback speed was the result of the variable numframes being checked prior to decrementing, resulting in two samples being requested instead of one.

The audio buffer starvation resulted, for example, when the requested buffer size was for 8192 samples, but only 256 samples arrived from the provided MF sample.

The PR:

  1. decrements numframes prior to checking the value; and
  2. requests additional audio samples from MF until the requested buffer size is fulfilled

This fixes the playback (both audio and video) of the ending video in One Finger Death Punch (264200), and the audio for the logos in Hell Yeah! Wrath of the Dead Rabbit (205230).

lib/FNAMF/main.c Outdated Show resolved Hide resolved
lib/FNAMF/main.c Outdated Show resolved Hide resolved
Recursively call tf_readaudio until dst_count is full.
@madewokherd
Copy link
Owner

I tested in One Finger Death Punch and got a crash in winegstreamer. Maybe because I'm using winehq?

@madewokherd
Copy link
Owner

Oh, yeah, I probably don't have the needed video codecs in 32-bit gstreamer.

@madewokherd
Copy link
Owner

Tested successfully, thanks for working on this.

@madewokherd madewokherd merged commit aa39d85 into madewokherd:main Jun 4, 2024
1 check failed
@redmcg redmcg deleted the bm_cw_23543 branch June 7, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants