mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
splitmuxsrc: Calculate the end offset of a fragment once known
If a new fragment is added with a valid duration but no offset then the start offset is set later based on the end offset of the previous fragment. At that point the end offset of this fragment can also be calculated and not doing so would give the next fragment the same start offset. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8069>
This commit is contained in:
parent
6b6fb4c8b8
commit
818f64a641
1 changed files with 16 additions and 0 deletions
|
@ -1457,6 +1457,14 @@ gst_splitmux_part_reader_set_start_offset (GstSplitMuxPartReader * reader,
|
|||
reader->ts_offset = ts_offset;
|
||||
GST_INFO_OBJECT (reader, "Time offset now %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (time_offset));
|
||||
|
||||
if (!reader->need_duration_measuring
|
||||
&& reader->info.start_offset != GST_CLOCK_TIME_NONE) {
|
||||
reader->end_offset = reader->info.start_offset + reader->info.duration;
|
||||
GST_INFO_OBJECT (reader, "End offset set to %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (reader->end_offset));
|
||||
}
|
||||
|
||||
SPLITMUX_PART_UNLOCK (reader);
|
||||
}
|
||||
|
||||
|
@ -1470,6 +1478,14 @@ gst_splitmux_part_reader_set_duration (GstSplitMuxPartReader * reader,
|
|||
|
||||
GST_INFO_OBJECT (reader, "Duration manually set to %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (duration));
|
||||
|
||||
if (!reader->need_duration_measuring
|
||||
&& reader->info.start_offset != GST_CLOCK_TIME_NONE) {
|
||||
reader->end_offset = reader->info.start_offset + reader->info.duration;
|
||||
GST_INFO_OBJECT (reader, "End offset set to %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (reader->end_offset));
|
||||
}
|
||||
|
||||
SPLITMUX_PART_UNLOCK (reader);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue