Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Merge requests
!30
Fix Linux issue with libretro audio
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix Linux issue with libretro audio
joamag/libretro-llinux-fix
into
master
Overview
0
Commits
11
Pipelines
1
Changes
1
Merged
João Magalhães
requested to merge
joamag/libretro-llinux-fix
into
master
1 year ago
Overview
0
Commits
11
Pipelines
1
Changes
1
Expand
Fixes a C callback issue with Linux libretro
1
0
Merge request reports
Viewing commit
3f6ea194
Prev
Next
Show latest version
1 file
+
0
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
3f6ea194
chore: simplified audio callback
· 3f6ea194
João Magalhães
authored
1 year ago
frontends/sdl/src/main.rs
+
1
−
16
Options
@@ -474,7 +474,7 @@ impl Emulator {
// in case there's new significant new audio data available in
// the emulator we must handle it, sending it to the audio callback
if
self
.system
.audio_buffer
()
.len
()
>
self
.max_audio_buffer
as
usize
{
if
self
.system
.audio_buffer
()
.len
()
>
=
self
.max_audio_buffer
as
usize
{
if
let
Some
(
audio
)
=
self
.audio
.as_mut
()
{
let
audio_buffer
=
self
.system
@@ -488,21 +488,6 @@ impl Emulator {
}
}
// in case there's pending audio data available in the emulator
// we must handle it, sending it to the audio callback
if
self
.system
.audio_buffer
()
.is_empty
()
{
if
let
Some
(
audio
)
=
self
.audio
.as_mut
()
{
let
audio_buffer
=
self
.system
.audio_buffer
()
.iter
()
.map
(|
v
|
*
v
as
f32
/
VOLUME
)
.collect
::
<
Vec
<
f32
>>
();
audio
.device
.queue_audio
(
&
audio_buffer
)
.unwrap
();
}
self
.system
.clear_audio_buffer
();
}
// in case there's at least one new frame that was drawn during
// during the current tick, then we need to flush it to the canvas,
// this separation between texture creation and canvas flush prevents
Loading