From: Benjamin Otte Date: Sun, 13 Apr 2003 03:11:06 +0000 (+0000) Subject: - if you don't know the timestamp, don't try to guess. Send an invalid one. X-Git-Tag: 1.19.3~505^2~4570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c19744b41991eec8c5e27d68194e2b88e285eff7;p=platform%2Fupstream%2Fgstreamer.git - if you don't know the timestamp, don't try to guess. Send an invalid one. Original commit message from CVS: - if you don't know the timestamp, don't try to guess. Send an invalid one. - use new macro GST_CLOCK_TIME_IS_VALID - send the first buffer, too (funny that nobody noticed for ages, that we don't send the first audio buffer ever, no?) --- diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index b7399bb..a6050b9 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -1130,7 +1130,7 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer) timestamp = GST_BUFFER_TIMESTAMP (buffer); /* handle timestamps */ - if (timestamp != -1) { + if (GST_CLOCK_TIME_IS_VALID (timestamp)) { /* if there is nothing queued (partial buffer), we prepare to set the * timestamp on the next buffer */ if (mad->tempsize == 0) { @@ -1274,7 +1274,7 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer) if (mad->frame.header.samplerate == 0) { g_warning ("mad->frame.header.samplerate is 0; timestamps cannot be calculated"); - time_offset = mad->base_time + 0; + time_offset = GST_CLOCK_TIME_NONE; } else { time_offset = mad->base_time + (mad->total_samples * GST_SECOND @@ -1291,7 +1291,7 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer) } if (GST_PAD_IS_USABLE (mad->srcpad) && - mad->segment_start < time_offset) { + mad->segment_start <= (time_offset == GST_CLOCK_TIME_NONE ? mad->base_time : time_offset)) { /* for sample accurate seeking, calculate how many samples to skip and send the remaining pcm samples */