voice: Convert byte amounts between different sample spec domains correctly.
authorTanu Kaskinen <tanu.kaskinen@digia.com>
Tue, 21 Feb 2012 15:27:59 +0000 (17:27 +0200)
committerTanu Kaskinen <tanu.kaskinen@digia.com>
Wed, 22 Feb 2012 13:04:02 +0000 (15:04 +0200)
commit8052ad041560b4f13d3fdd3fbedfebfe6da17c4b
tree8b34b282f94a924812cd942f4dbd566ba3361df8
parent77d9fe58009fa81a83b21fb1cde50603ff0c6632
voice: Convert byte amounts between different sample spec domains correctly.

Earlier the raw and voip sinks didn't convert rewind request
sizes at all when passing on the request to the hw sink
input. Additionally, the hw sink input and source output
used a conversion algorithm that didn't take sample rate
differences into account.

In some cases the wrong rewind sizes could cause a crash:
pa_sink_input_process_rewind() contains an assertion that
checks that the rewind size is frame aligned according to
the sink sample spec. Skipping the rewind request size
conversion in the voip sink sometimes resulted in a
situation where the frame alignment was broken.
src/voice/voice-hw-sink-input.c
src/voice/voice-hw-source-output.c
src/voice/voice-raw-sink.c
src/voice/voice-util.c
src/voice/voice-util.h
src/voice/voice-voip-sink.c