mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
tsdemux: Properly carry over the timestamp
This commit is contained in:
parent
a3ba21d3b9
commit
a646d8d1e2
1 changed files with 10 additions and 4 deletions
|
@ -2229,6 +2229,7 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream)
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
MpegTSBaseStream *bs = (MpegTSBaseStream *) stream;
|
MpegTSBaseStream *bs = (MpegTSBaseStream *) stream;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
GstClockTime ts;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (stream->pad,
|
GST_DEBUG_OBJECT (stream->pad,
|
||||||
"stream:%p, pid:0x%04x stream_type:%d state:%d", stream, bs->pid,
|
"stream:%p, pid:0x%04x stream_type:%d state:%d", stream, bs->pid,
|
||||||
|
@ -2263,19 +2264,24 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream)
|
||||||
stream->currentlist = g_list_reverse (stream->currentlist);
|
stream->currentlist = g_list_reverse (stream->currentlist);
|
||||||
buf = (GstBuffer *) stream->currentlist->data;
|
buf = (GstBuffer *) stream->currentlist->data;
|
||||||
|
|
||||||
|
ts = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (stream->pad,
|
GST_DEBUG_OBJECT (stream->pad,
|
||||||
"delta %" GST_TIME_FORMAT " stream->pts %" GST_TIME_FORMAT,
|
"ts %" GST_TIME_FORMAT " delta %" GST_TIME_FORMAT " stream->pts %"
|
||||||
GST_TIME_ARGS (demux->pts_delta), GST_TIME_ARGS (stream->pts));
|
GST_TIME_FORMAT, GST_TIME_ARGS (ts), GST_TIME_ARGS (demux->pts_delta),
|
||||||
|
GST_TIME_ARGS (stream->pts));
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (demux->pts_delta)
|
if (GST_CLOCK_TIME_IS_VALID (demux->pts_delta)
|
||||||
&& GST_CLOCK_TIME_IS_VALID (stream->pts)
|
&& GST_CLOCK_TIME_IS_VALID (stream->pts)
|
||||||
&& !GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) {
|
&& !GST_CLOCK_TIME_IS_VALID (ts)) {
|
||||||
GST_BUFFER_TIMESTAMP (buf) = stream->pts - demux->pts_delta;
|
ts = stream->pts - demux->pts_delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = stream->currentlist->next; tmp; tmp = tmp->next) {
|
for (tmp = stream->currentlist->next; tmp; tmp = tmp->next) {
|
||||||
buf = gst_buffer_join (buf, (GstBuffer *) tmp->data);
|
buf = gst_buffer_join (buf, (GstBuffer *) tmp->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_BUFFER_TIMESTAMP (buf) = ts;
|
||||||
GST_DEBUG_OBJECT (stream->pad,
|
GST_DEBUG_OBJECT (stream->pad,
|
||||||
"Pushing buffer with timestamp: %" GST_TIME_FORMAT,
|
"Pushing buffer with timestamp: %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
||||||
|
|
Loading…
Reference in a new issue