Commit af354dbe authored by Wim Taymans's avatar Wim Taymans
Browse files

gst-libs/gst/audio/gstbaseaudiosrc.c: Avoid nasty int overflows after about 12...

gst-libs/gst/audio/gstbaseaudiosrc.c: Avoid nasty int overflows after about 12 hours and 25 minutes when these code p...

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_offset), (gst_base_audio_src_create):
Avoid nasty int overflows after about 12 hours and 25 minutes when these
code paths are triggered.
A free beer to Håvard Graff for finding this!
parent d80a5c9d
2008-11-27 Wim Taymans <wim.taymans@collabora.co.uk>
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_offset), (gst_base_audio_src_create):
Avoid nasty int overflows after about 12 hours and 25 minutes when these
code paths are triggered.
A free beer to Håvard Graff for finding this!
2008-11-27 Wim Taymans <wim.taymans@collabora.co.uk>
 
Patch by: 이문형 <iwings at gmail dot com>
......@@ -718,7 +718,7 @@ gst_base_audio_src_get_offset (GstBaseAudioSrc * src)
if (diff >= segtotal) {
GST_DEBUG_OBJECT (src, "dropped, align to segment %d", segdone);
/* sample would be dropped, position to next playable position */
sample = (segdone - segtotal + 1) * sps;
sample = ((guint64) (segdone - segtotal + 1)) * sps;
}
return sample;
......@@ -922,7 +922,7 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
ringbuffer->segbase -= segment_diff;
/* we calculate the new sample value */
new_sample = new_first_segment * sps;
new_sample = ((guint64) new_first_segment) * sps;
/* and get the relative time to this -> our new timestamp */
timestamp =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment