0
0
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:
jp9000 2019-08-31 01:09:14 -07:00
parent 03e008fd2e
commit 1a72b04951

View File

@ -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;