mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
qtdemux: Use the timestamp of the moof as the base fragment start
In SmoothStreaming fragmented scenario, the timestamps are calculated starting from the fragment buffer timestamp. When there is a not-linked return from downstream, qtdemux will return upstream and will keep the non-pushed data into its adapter. On a new fragment buffer pushed to qtdemux, the new buffer timestamp would overwrite the previous one that should be used on the still to be pushed buffers. Because of this, this patch will also update the fragment_start timestamp from the adapter last pts to make sure the moof and timestamps are in sync and will result in correct timestamps for all fragments.
This commit is contained in:
parent
45c16599ff
commit
079dde49ed
1 changed files with 4 additions and 0 deletions
|
@ -4787,6 +4787,10 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf)
|
|||
} else if (fourcc == FOURCC_moof) {
|
||||
if ((demux->got_moov || demux->media_caps) && demux->fragmented) {
|
||||
GST_DEBUG_OBJECT (demux, "Parsing [moof]");
|
||||
|
||||
/* the timestamp of the moof buffer is relevant as some scenarios
|
||||
* won't have the initial timestamp in the atoms */
|
||||
demux->fragment_start = gst_adapter_prev_pts (demux->adapter, NULL);
|
||||
if (!qtdemux_parse_moof (demux, data, demux->neededbytes,
|
||||
demux->offset, NULL)) {
|
||||
gst_adapter_unmap (demux->adapter);
|
||||
|
|
Loading…
Reference in a new issue