gst-libs/gst/audio/gstbaseaudiosink.c: Fix playback of non-synchronised streams by assuming a rate of 1.0 instead of ...

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render):
Fix playback of non-synchronised streams by assuming a rate
of 1.0 instead of a random one.

Makes this work again:

gst-launch filesrc location=raw_audio.file ! 'audio/x-raw-int,
endianness=(int)4321, signed=(boolean)true, width=(int)16,
depth=(int)16, rate=(int)44100, channels=(int)2' ! audioconvert !
audioresample ! alsasink
This commit is contained in:
Jan Schmidt 2006-01-17 11:43:49 +00:00
parent f61f4b2781
commit 04333a568c
2 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,17 @@
2006-01-17 Jan Schmidt <thaytan@mad.scientist.com>
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render):
Fix playback of non-synchronised streams by assuming a rate
of 1.0 instead of a random one.
Makes this work again:
gst-launch filesrc location=raw_audio.file ! 'audio/x-raw-int,
endianness=(int)4321, signed=(boolean)true, width=(int)16,
depth=(int)16, rate=(int)44100, channels=(int)2' ! audioconvert !
audioresample ! alsasink
=== release 0.10.2 ===
2006-01-16 Thomas Vander Stichele <thomas at apestaart dot org>

View file

@ -405,7 +405,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
guint size;
guint samples;
gint bps;
gdouble crate;
gdouble crate = 1.0;
GstClockTime crate_num;
GstClockTime crate_denom;
GstClockTime cinternal, cexternal;
@ -438,6 +438,8 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
* sample ASAP */
if (!GST_CLOCK_TIME_IS_VALID (time) || !bsink->sync) {
render_offset = gst_base_audio_sink_get_offset (sink);
GST_DEBUG ("Buffer of size %u has no time. Using render_offset=%"
G_GUINT64_FORMAT, GST_BUFFER_SIZE (buf), render_offset);
goto no_sync;
}
@ -488,12 +490,11 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
GST_DEBUG ("resync");
}
no_sync:
crate = ((gdouble) crate_num) / crate_denom;
GST_DEBUG_OBJECT (sink,
"internal %" G_GUINT64_FORMAT ", %" G_GUINT64_FORMAT ", rate %g",
cinternal, cexternal, crate);
no_sync:
/* clip length based on rate */
samples = MIN (samples, samples / (crate * ABS (bsink->segment.rate)));