Merge pull request #511 from dima-xd/sample

avplayer: Fix data returned by sceAvPlayerGetAudioData
This commit is contained in:
georgemoralis 2024-08-21 16:53:01 +03:00 committed by GitHub
commit 3426ad8cc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -359,6 +359,7 @@ bool AvPlayerSource::GetAudioData(SceAvPlayerFrameInfo& audio_info) {
audio_info = {}; audio_info = {};
audio_info.timestamp = frame->info.timestamp; audio_info.timestamp = frame->info.timestamp;
audio_info.pData = reinterpret_cast<u8*>(frame->info.pData); audio_info.pData = reinterpret_cast<u8*>(frame->info.pData);
audio_info.details.audio.sample_rate = frame->info.details.audio.sample_rate;
audio_info.details.audio.size = frame->info.details.audio.size; audio_info.details.audio.size = frame->info.details.audio.size;
audio_info.details.audio.channel_count = frame->info.details.audio.channel_count; audio_info.details.audio.channel_count = frame->info.details.audio.channel_count;
return true; return true;
@ -655,6 +656,7 @@ Frame AvPlayerSource::PrepareAudioFrame(FrameBuffer buffer, const AVFrame& frame
.audio = .audio =
{ {
.channel_count = u16(frame.ch_layout.nb_channels), .channel_count = u16(frame.ch_layout.nb_channels),
.sample_rate = u32(frame.sample_rate),
.size = u32(size), .size = u32(size),
}, },
}, },