audio: fixed reversing issue

This commit is contained in:
itsmattkc
2021-07-23 22:08:44 -07:00
parent cdc8df1dc5
commit 7c21cf2339
+4 -2
View File
@@ -114,10 +114,12 @@ qint64 AudioOutputDeviceProxy::ReverseAwareRead(char *data, qint64 maxlen)
if (playback_speed_ < 0) {
// If we're reversing, we'll seek back by maxlen bytes before we read
new_pos = device_->pos() - maxlen;
qint64 len_adjusted_by_channels = maxlen / params_.channel_count();
new_pos = device_->pos() - len_adjusted_by_channels;
if (new_pos < 0) {
maxlen = device_->pos();
maxlen = device_->pos() * params_.channel_count();
new_pos = 0;
}