From 81bbf631d5f0844f1cb45801bc1ed35924e51561 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 7 Jun 2004 01:41:37 +0000 Subject: [PATCH] ext/alsa/gstalsa.c: cast to GstClockTime to get higher granularity Original commit message from CVS: * ext/alsa/gstalsa.c: (gst_alsa_samples_to_timestamp): cast to GstClockTime to get higher granularity * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event): use gst_element_set_time_delay to get the exact time * ext/mad/gstmad.c: (gst_mad_chain): use the negotiated rate instead of the current frame's rate which might be wrong because of bit errors. This avoids emitting totally bogus timestamps and screwing sync. (fixes #143454) --- ChangeLog | 12 ++++++++++++ ext/mad/gstmad.c | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 654d8007d3..e3094409a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-06-07 Benjamin Otte + + * ext/alsa/gstalsa.c: (gst_alsa_samples_to_timestamp): + cast to GstClockTime to get higher granularity + * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event): + use gst_element_set_time_delay to get the exact time + * ext/mad/gstmad.c: (gst_mad_chain): + use the negotiated rate instead of the current frame's rate which + might be wrong because of bit errors. This avoids emitting totally + bogus timestamps and screwing sync. + (fixes #143454) + 2004-06-07 Tim-Philipp Müller reviewed by Benjamin Otte diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index b4e578694a..900d17948f 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -1376,9 +1376,8 @@ gst_mad_chain (GstPad * pad, GstData * _data) &mad->total_samples); mad->last_ts = GST_CLOCK_TIME_NONE; } - time_offset = mad->total_samples * GST_SECOND - / mad->frame.header.samplerate; - time_duration = (nsamples * GST_SECOND / mad->frame.header.samplerate); + time_offset = mad->total_samples * GST_SECOND / mad->rate; + time_duration = (nsamples * GST_SECOND / mad->rate); } if (mad->index) {