Bug 54251 - protocol-esound, protocol-simple: Rewind after underrun can be too large
Summary: protocol-esound, protocol-simple: Rewind after underrun can be too large
Status: NEW
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 08:29 UTC by Tanu Kaskinen
Modified: 2012-08-30 08:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tanu Kaskinen 2012-08-30 08:29:52 UTC
Rewinding after an underrun should be done like this:

pa_sink_input_request_rewind(s->sink_input, (size_t) (s->sink_input->thread_info.underrun_for == (uint64_t) -1 ? 0 : s->sink_input->thread_info.underrun_for), FALSE, TRUE, FALSE);

(The example is from protocol-native.c.)

That ensures that the received data won't overwrite valid data in case the underrun was so short that the sink still has data left from time before the underrun started.

protocol-esound.c currently does this:

pa_sink_input_request_rewind(c->sink_input, 0, FALSE, TRUE, FALSE);

Giving zero as the rewind amount means that a full rewind will be done, regardless of whether valid data might get overwritten. If valid data gets overwritten, there will be a skip in the audio.

protocol-simple.c has the same bug.


bug/show.html.tmpl processed on Jun 28, 2016 at 18:37:58.
(provided by the Example extension).