Skip to content

Commit af495fe

Browse files
committed
Fix build. Fix audio crash when there is no listener due to format incompatibility.
1 parent 95b00ea commit af495fe

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

SerialPrograms/Source/CommonFramework/AudioPipeline/Backends/AudioPassthroughPairQt.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ class AudioPassthroughPairQt::SampleListener final : public AudioFloatStreamList
6060
AudioPassthroughPairQt& parent = m_parent;
6161
WriteSpinLock lg(parent.m_lock);
6262
if (parent.m_writer){
63-
parent.m_writer->operator AudioFloatStreamListener&().on_samples(data, frames);
63+
AudioFloatStreamListener* listener = parent.m_writer->float_stream_listener();
64+
if (listener){
65+
listener->on_samples(data, frames);
66+
}
6467
}
6568
if (parent.m_fft_runner){
6669
parent.m_fft_runner->on_samples(data, frames);

SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioSink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ AudioSink::AudioSink(Logger& logger, const AudioDeviceInfo& device, AudioChannel
156156
);
157157
}
158158

159-
AudioSink::operator AudioFloatStreamListener&(){
159+
AudioFloatStreamListener* AudioSink::float_stream_listener(){
160160
auto scope_check = m_sanitizer.check_scope();
161-
return *m_writer;
161+
return m_writer.get();
162162
}
163163
void AudioSink::set_volume(double volume){
164164
auto scope_check = m_sanitizer.check_scope();

SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioSink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AudioSink{
3131
size_t channels() const{ return m_channels; }
3232
size_t samples_per_frame() const{ return m_channels * m_multiplier; }
3333

34-
operator AudioFloatStreamListener&();
34+
AudioFloatStreamListener* float_stream_listener();
3535

3636
void set_volume(double volume);
3737

SerialPrograms/Source/PokemonSV/Options/PokemonSV_TeraRollFilter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include <iterator>
78
#include <algorithm>
89
#include "Common/Cpp/PrettyPrint.h"
910
#include "CommonFramework/VideoPipeline/VideoFeed.h"

0 commit comments

Comments
 (0)