From: <wt...@ke...> - 2006-07-24 16:47:23
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: wtay Date: Mon Jul 24 2006 16:47:22 UTC Log message: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_render): Don't try to align a sample to an unknown value. Modified files: . : ChangeLog gst-libs/gst/audio: gstbaseaudiosink.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.2791&r2=1.2792 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c.diff?r1=1.60&r2=1.61 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.2791 retrieving revision 1.2792 diff -u -d -r1.2791 -r1.2792 --- ChangeLog 24 Jul 2006 15:14:17 -0000 1.2791 +++ ChangeLog 24 Jul 2006 16:47:10 -0000 1.2792 @@ -1,6 +1,12 @@ 2006-07-24 Wim Taymans <wi...@fl...> * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_base_audio_sink_render): + Don't try to align a sample to an unknown value. + +2006-07-24 Wim Taymans <wi...@fl...> + * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_provide_clock), (gst_base_audio_sink_render): When the audio clock is slaved to another clock, never try to align samples but trust the rate interpolation algorithm. Index: gstbaseaudiosink.c RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- gstbaseaudiosink.c 24 Jul 2006 15:14:17 -0000 1.60 +++ gstbaseaudiosink.c 24 Jul 2006 16:47:10 -0000 1.61 @@ -593,6 +593,12 @@ goto no_align; } + if (G_UNLIKELY (sink->next_sample == -1)) { + GST_DEBUG_OBJECT (sink, + "no align possible: no previous sample position known"); + goto no_align; + } /* now try to align the sample to the previous one */ diff = ABS ((gint64) render_offset - (gint64) sink->next_sample); @@ -600,7 +606,7 @@ * should be enough to compensate for various rounding errors in the timestamp * and sample offset position. We always resync if we got a discont anyway and * non-discont should be aligned by definition. */ - if (diff < ringbuf->spec.rate / DIFF_TOLERANCE) { + if (G_LIKELY (diff < ringbuf->spec.rate / DIFF_TOLERANCE)) { GST_DEBUG_OBJECT (sink, "align with prev sample, %" G_GINT64_FORMAT " < %lu", diff, ringbuf->spec.rate / DIFF_TOLERANCE); |