apply_diff_time() fails when dropping bytes from the playback stream
and the sample spec of sink and source differ as source's sample spec is
used. Fix this by using sink's sample spec.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
int64_t diff;
if (diff_time < 0) {
- diff = pa_usec_to_bytes(-diff_time, &u->source_output->sample_spec);
+ diff = pa_usec_to_bytes(-diff_time, &u->sink_input->sample_spec);
if (diff > 0) {
/* add some extra safety samples to compensate for jitter in the
* timings */
- diff += 10 * pa_frame_size (&u->source_output->sample_spec);
+ diff += 10 * pa_frame_size (&u->sink_input->sample_spec);
pa_log("Playback after capture (%lld), drop sink %lld", (long long) diff_time, (long long) diff);