if (scale_dur)
*scale_dur = duration;
} else {
+ /* duration is guint so this cannot overflow */
duration = base->duration * GST_SECOND;
if (scale_dur)
*scale_dur = duration;
S = (GstSNode *) list->data;
GST_LOG ("Processing S node: d=%" G_GUINT64_FORMAT " r=%d t=%"
G_GUINT64_FORMAT, S->d, S->r, S->t);
- duration = S->d * GST_SECOND;
timescale =
stream->cur_segment_list->MultSegBaseType->SegBaseType->timescale;
- duration /= timescale;
+ duration = gst_util_uint64_scale (S->d, GST_SECOND, timescale);
+
if (S->t > 0) {
start = S->t;
- start_time = S->t * GST_SECOND;
- start_time /= timescale;
+ start_time = gst_util_uint64_scale (S->t, GST_SECOND, timescale);
start_time += PeriodStart;
}
S = (GstSNode *) list->data;
GST_LOG ("Processing S node: d=%" G_GUINT64_FORMAT " r=%u t=%"
G_GUINT64_FORMAT, S->d, S->r, S->t);
- duration = S->d * GST_SECOND;
timescale = mult_seg->SegBaseType->timescale;
- duration /= timescale;
+ duration = gst_util_uint64_scale (S->d, GST_SECOND, timescale);
if (S->t > 0) {
start = S->t;
- start_time = S->t * GST_SECOND;
- start_time /= timescale;
+ start_time = gst_util_uint64_scale (S->t, GST_SECOND, timescale);
start_time += PeriodStart;
}