Browse Source
Merge pull request #11952 from liamwhite/opus_stereo_count
opus: Allow 0 stereo count
pull/15/merge
liamwhite
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
src/audio_core/adsp/apps/opus/opus_decoder.cpp
-
src/audio_core/opus/decoder_manager.cpp
|
|
|
@ -30,9 +30,9 @@ bool IsValidMultiStreamChannelCount(u32 channel_count) { |
|
|
|
return channel_count <= OpusStreamCountMax; |
|
|
|
} |
|
|
|
|
|
|
|
bool IsValidMultiStreamStreamCounts(s32 total_stream_count, s32 sterero_stream_count) { |
|
|
|
bool IsValidMultiStreamStreamCounts(s32 total_stream_count, s32 stereo_stream_count) { |
|
|
|
return IsValidMultiStreamChannelCount(total_stream_count) && total_stream_count > 0 && |
|
|
|
sterero_stream_count > 0 && sterero_stream_count <= total_stream_count; |
|
|
|
stereo_stream_count >= 0 && stereo_stream_count <= total_stream_count; |
|
|
|
} |
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ bool IsValidSampleRate(u32 sample_rate) { |
|
|
|
} |
|
|
|
|
|
|
|
bool IsValidStreamCount(u32 channel_count, u32 total_stream_count, u32 stereo_stream_count) { |
|
|
|
return total_stream_count > 0 && stereo_stream_count > 0 && |
|
|
|
return total_stream_count > 0 && static_cast<s32>(stereo_stream_count) >= 0 && |
|
|
|
stereo_stream_count <= total_stream_count && |
|
|
|
total_stream_count + stereo_stream_count <= channel_count; |
|
|
|
} |
|
|
|
|