Skip to content

Commit defff7e

Browse files
committed
Assign length to AudioStreamRandomizer
1 parent 8edf97e commit defff7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

servers/audio/audio_stream.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,13 @@ String AudioStreamRandomizer::get_stream_name() const {
729729
}
730730

731731
double AudioStreamRandomizer::get_length() const {
732-
return 0;
732+
double greatest_length = 0.0;
733+
for (const PoolEntry &entry : audio_stream_pool) {
734+
if (entry.stream.is_valid()) {
735+
greatest_length = MAX(greatest_length, entry.stream->get_length());
736+
}
737+
}
738+
return greatest_length;
733739
}
734740

735741
bool AudioStreamRandomizer::is_monophonic() const {

0 commit comments

Comments
 (0)