mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
gst-libs/gst/audio/gstbaseaudiosink.c: Add some more info in a WARNING.
Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_render): Add some more info in a WARNING. * gst-libs/gst/audio/gstbaseaudiosrc.c: (gst_base_audio_src_create): Handle PAUSE in create function, use new -core addition to wait for playing. Fixes pausing and resuming capture from an audiosrc. * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_commit), (gst_ring_buffer_read): Constify some more. Caller supports interrupted reads now.
This commit is contained in:
parent
bfbdfb8d45
commit
1980f16731
4 changed files with 38 additions and 9 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2006-09-27 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||
(gst_base_audio_sink_render):
|
||||
Add some more info in a WARNING.
|
||||
|
||||
* gst-libs/gst/audio/gstbaseaudiosrc.c:
|
||||
(gst_base_audio_src_create):
|
||||
Handle PAUSE in create function, use new -core addition to
|
||||
wait for playing. Fixes pausing and resuming capture from an
|
||||
audiosrc.
|
||||
|
||||
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_commit),
|
||||
(gst_ring_buffer_read):
|
||||
Constify some more.
|
||||
Caller supports interrupted reads now.
|
||||
|
||||
2006-09-27 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* tests/check/Makefile.am:
|
||||
|
|
|
@ -649,6 +649,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
}
|
||||
|
||||
no_align:
|
||||
/* crate contains diff against the clock we are using in the pipeline. */
|
||||
crate =
|
||||
gst_guint64_to_gdouble (crate_num) / gst_guint64_to_gdouble (crate_denom);
|
||||
GST_DEBUG_OBJECT (sink,
|
||||
|
|
|
@ -449,10 +449,10 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
|||
GstBuffer *buf;
|
||||
guchar *data;
|
||||
guint samples;
|
||||
guint res;
|
||||
guint64 sample;
|
||||
gint bps;
|
||||
GstRingBuffer *ringbuffer;
|
||||
guint read;
|
||||
|
||||
ringbuffer = src->ringbuffer;
|
||||
|
||||
|
@ -488,10 +488,22 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
|||
buf = gst_buffer_new_and_alloc (length);
|
||||
data = GST_BUFFER_DATA (buf);
|
||||
|
||||
/* read the sample */
|
||||
res = gst_ring_buffer_read (ringbuffer, sample, data, samples);
|
||||
if (G_UNLIKELY (res == -1))
|
||||
goto stopped;
|
||||
do {
|
||||
read = gst_ring_buffer_read (ringbuffer, sample, data, samples);
|
||||
GST_DEBUG_OBJECT (src, "read %u of %u", read, samples);
|
||||
/* if we read all, we're done */
|
||||
if (read == samples)
|
||||
break;
|
||||
|
||||
/* else something interrupted us and we wait for playing again. */
|
||||
if (gst_base_src_wait_playing (bsrc) != GST_FLOW_OK)
|
||||
goto stopped;
|
||||
|
||||
/* read next samples */
|
||||
sample += read;
|
||||
samples -= read;
|
||||
data += read * bps;
|
||||
} while (TRUE);
|
||||
|
||||
/* mark discontinuity if needed */
|
||||
if (G_UNLIKELY (sample != src->next_sample) && src->next_sample != -1) {
|
||||
|
|
|
@ -134,8 +134,8 @@ gst_ring_buffer_finalize (GObject * object)
|
|||
|
||||
typedef struct
|
||||
{
|
||||
GstBufferFormat format;
|
||||
guint8 silence[4];
|
||||
const GstBufferFormat format;
|
||||
const guint8 silence[4];
|
||||
} FormatDef;
|
||||
|
||||
static const FormatDef linear_defs[4 * 2 * 2] = {
|
||||
|
@ -1387,8 +1387,7 @@ gst_ring_buffer_read (GstRingBuffer * buf, guint64 sample, guchar * data,
|
|||
not_started:
|
||||
{
|
||||
GST_DEBUG_OBJECT (buf, "stopped processing");
|
||||
/* FIXME, return len - to_read after fixing caller */
|
||||
return -1;
|
||||
return len - to_read;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue