mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
movies: set length of unseekable ogg/Opus streams upon reaching EOF
This is one of a series of commits that will make it possible to loop compressed ogg and Opus streams.
This commit is contained in:
parent
c329a41dd3
commit
2f2354550d
@ -240,6 +240,9 @@ read_samples(int n, int16_t *data) {
|
||||
data += read_samples * _audio_channels;
|
||||
_samples_read += read_samples;
|
||||
} else {
|
||||
if (read_samples == 0 && _length == 1.0E10) {
|
||||
_length = op_pcm_tell(_op) / 48000.0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -158,6 +158,9 @@ read_samples(int n, int16_t *data) {
|
||||
buffer += read_bytes;
|
||||
length -= read_bytes;
|
||||
} else {
|
||||
if (read_bytes == 0 && _length == 1.0E10) {
|
||||
_length = ov_time_tell(&_ov);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user