mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
fakesrc: avoid time overflow with datarate
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3433>
This commit is contained in:
parent
dfb5e3365e
commit
9d829b85e4
1 changed files with 4 additions and 2 deletions
|
@ -805,9 +805,11 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
||||||
GST_BUFFER_OFFSET (buf) = offset;
|
GST_BUFFER_OFFSET (buf) = offset;
|
||||||
|
|
||||||
if (src->datarate > 0) {
|
if (src->datarate > 0) {
|
||||||
time = (src->bytes_sent * GST_SECOND) / src->datarate;
|
time =
|
||||||
|
gst_util_uint64_scale_int (src->bytes_sent, GST_SECOND, src->datarate);
|
||||||
|
|
||||||
GST_BUFFER_DURATION (buf) = size * GST_SECOND / src->datarate;
|
GST_BUFFER_DURATION (buf) =
|
||||||
|
gst_util_uint64_scale_int (size, GST_SECOND, src->datarate);
|
||||||
} else if (gst_base_src_is_live (basesrc)) {
|
} else if (gst_base_src_is_live (basesrc)) {
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue