mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
pulsesink: handle border cases in resampler
This commit is contained in:
parent
c6c769aa8a
commit
0bd984c52f
1 changed files with 5 additions and 2 deletions
|
@ -800,6 +800,7 @@ gst_pulseringbuffer_start (GstRingBuffer * buf)
|
||||||
pa_threaded_mainloop_lock (psink->mainloop);
|
pa_threaded_mainloop_lock (psink->mainloop);
|
||||||
GST_DEBUG_OBJECT (psink, "starting");
|
GST_DEBUG_OBJECT (psink, "starting");
|
||||||
pbuf->paused = FALSE;
|
pbuf->paused = FALSE;
|
||||||
|
gst_pulsering_set_corked (pbuf, FALSE, FALSE);
|
||||||
pa_threaded_mainloop_unlock (psink->mainloop);
|
pa_threaded_mainloop_unlock (psink->mainloop);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -927,7 +928,7 @@ G_STMT_START { \
|
||||||
memcpy (d, se, bps); \
|
memcpy (d, se, bps); \
|
||||||
se -= bps; \
|
se -= bps; \
|
||||||
*accum += outr; \
|
*accum += outr; \
|
||||||
while ((*accum << 1) >= inr) { \
|
while (d < de && (*accum << 1) >= inr) { \
|
||||||
*accum -= inr; \
|
*accum -= inr; \
|
||||||
d += bps; \
|
d += bps; \
|
||||||
} \
|
} \
|
||||||
|
@ -944,7 +945,7 @@ G_STMT_START { \
|
||||||
memcpy (d, se, bps); \
|
memcpy (d, se, bps); \
|
||||||
d += bps; \
|
d += bps; \
|
||||||
*accum += inr; \
|
*accum += inr; \
|
||||||
while ((*accum << 1) >= outr) { \
|
while (s <= se && (*accum << 1) >= outr) { \
|
||||||
*accum -= outr; \
|
*accum -= outr; \
|
||||||
se -= bps; \
|
se -= bps; \
|
||||||
} \
|
} \
|
||||||
|
@ -1009,6 +1010,8 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
|
||||||
inr = in_samples - 1;
|
inr = in_samples - 1;
|
||||||
outr = out_samples - 1;
|
outr = out_samples - 1;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (psink, "in %d, out %d", inr, outr);
|
||||||
|
|
||||||
/* data_end points to the last sample we have to write, not past it. This is
|
/* data_end points to the last sample we have to write, not past it. This is
|
||||||
* needed to properly handle reverse playback: it points to the last sample. */
|
* needed to properly handle reverse playback: it points to the last sample. */
|
||||||
data_end = data + (bps * inr);
|
data_end = data + (bps * inr);
|
||||||
|
|
Loading…
Reference in a new issue