* 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:
Stephan Aßmus
2009-05-11 08:05:51 +00:00
parent 2a2eb31535
commit 94aabcd393
@@ -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 // Stream interrupts seem to arrive too early on most HDA
// so we adjust buffer descriptors to take this into account // so we adjust buffer descriptors to take this into account
uint32 offset = (stream->sample_size * stream->num_channels) * stream->rate / 48000; 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) if (stream->controller->pci_info.vendor_id != INTEL_VENDORID)
offset *= 32; offset *= 32;