mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
use base class' newsegment to properly timestamp
Original commit message from CVS: use base class' newsegment to properly timestamp
This commit is contained in:
parent
98fbd82d1c
commit
f0f2b133dd
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-08-26 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/audioresample/gstaudioresample.c:
|
||||
use base class' newsegment to properly timestamp
|
||||
|
||||
2005-08-26 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/audioconvert/audioconvert.c: (if), (float),
|
||||
|
|
|
@ -295,9 +295,12 @@ gboolean
|
|||
} else {
|
||||
/* take a best guess, this is called cheating */
|
||||
*othersize = floor (size * state->i_rate / state->o_rate);
|
||||
*othersize -= *othersize % state->sample_size;
|
||||
}
|
||||
*othersize += state->sample_size;
|
||||
|
||||
g_assert (*othersize % state->sample_size == 0);
|
||||
|
||||
/* we make room for one extra sample, given that the resampling filter
|
||||
* can output an extra one for non-integral i_rate/o_rate */
|
||||
GST_DEBUG_OBJECT (base, "transformed size %d to %d", size, *othersize);
|
||||
|
@ -396,7 +399,7 @@ static GstFlowReturn
|
|||
outsize, outsamples);
|
||||
|
||||
GST_BUFFER_OFFSET (outbuf) = audioresample->offset;
|
||||
GST_BUFFER_TIMESTAMP (outbuf) =
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = base->segment_start +
|
||||
audioresample->offset * GST_SECOND / audioresample->o_rate;
|
||||
|
||||
audioresample->offset += outsamples;
|
||||
|
@ -405,7 +408,7 @@ static GstFlowReturn
|
|||
/* we calculate DURATION as the difference between "next" timestamp
|
||||
* and current timestamp so we ensure a contiguous stream, instead of
|
||||
* having rounding errors. */
|
||||
GST_BUFFER_DURATION (outbuf) =
|
||||
GST_BUFFER_DURATION (outbuf) = base->segment_start +
|
||||
audioresample->offset * GST_SECOND / audioresample->o_rate -
|
||||
GST_BUFFER_TIMESTAMP (outbuf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue