mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
libobs: Make sure to offset unpause audio data
When an unpause occurs, it takes an audio segment and splits it at the exact point corresponding to the pause timestamp, and then it's supposed to only send the ending part of the split. However, the audio pointers were not being incremented, therefore it was sending the front of the audio segment to instead of the back of the audio segment by mistake.
This commit is contained in:
parent
03e008fd2e
commit
1a72b04951
@ -1185,6 +1185,12 @@ static void unpause_audio(struct pause_data *pause, struct audio_data *data,
|
||||
uint64_t cutoff_frames = pause->ts_end - data->timestamp;
|
||||
cutoff_frames = ns_to_audio_frames(sample_rate, cutoff_frames);
|
||||
|
||||
for (size_t i = 0; i < MAX_AV_PLANES; i++) {
|
||||
if (!data->data[i])
|
||||
break;
|
||||
data->data[i] += cutoff_frames * sizeof(float);
|
||||
}
|
||||
|
||||
data->timestamp = pause->ts_start;
|
||||
data->frames = data->frames - (uint32_t)cutoff_frames;
|
||||
pause->ts_start = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user