* Fix by Cyan: Do the offset calculation taking the rate base into account.
Fixes using the HDA driver with frame rates based on 44100Hz. * Automatic white space cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30704 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -547,9 +547,16 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
|
||||
}
|
||||
}
|
||||
|
||||
// Stream interrupts seem to arrive too early on most HDA
|
||||
// so we adjust buffer descriptors to take this into account
|
||||
uint32 offset = (stream->sample_size * stream->num_channels) * stream->rate / 48000;
|
||||
// Stream interrupts seem to arrive too early on most HDA
|
||||
// so we adjust buffer descriptors to take this into account
|
||||
uint32 offset;
|
||||
if (format & FORMAT_44_1_BASE_RATE) {
|
||||
offset = (stream->sample_size * stream->num_channels) * stream->rate
|
||||
/ 44100;
|
||||
} else {
|
||||
offset = (stream->sample_size * stream->num_channels) * stream->rate
|
||||
/ 48000;
|
||||
}
|
||||
if (stream->controller->pci_info.vendor_id != INTEL_VENDORID)
|
||||
offset *= 32;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user