summaryrefslogtreecommitdiff
path: root/ext/resindvd/gstmpegdemux.c
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@noraisin.net>2012-08-31 15:28:29 -0700
committerJan Schmidt <thaytan@noraisin.net>2012-09-01 16:09:59 -0700
commitf2d0c6a89ee771beafbe428b6c224f31779bd319 (patch)
tree8a631140c66d028eae474f412d740ee6ee328de8 /ext/resindvd/gstmpegdemux.c
parentf3e66bd80d05cbdf216a22cd77fd0b577a9d4e6d (diff)
downloadgstreamer-plugins-bad-f2d0c6a89ee771beafbe428b6c224f31779bd319.tar.gz
resindvd/mpegdemux: Send both PTS and DTS downstream
Now that we can.
Diffstat (limited to 'ext/resindvd/gstmpegdemux.c')
-rw-r--r--ext/resindvd/gstmpegdemux.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/resindvd/gstmpegdemux.c b/ext/resindvd/gstmpegdemux.c
index 1170d60e5..34d500504 100644
--- a/ext/resindvd/gstmpegdemux.c
+++ b/ext/resindvd/gstmpegdemux.c
@@ -430,7 +430,7 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
GstBuffer * buf)
{
GstFlowReturn result;
- guint64 timestamp;
+ GstClockTime pts = GST_CLOCK_TIME_NONE, dts = GST_CLOCK_TIME_NONE;
guint size;
if (stream == NULL)
@@ -438,9 +438,9 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
/* timestamps */
if (G_UNLIKELY (demux->next_pts != G_MAXUINT64))
- timestamp = MPEGTIME_TO_GSTTIME (demux->next_pts);
- else
- timestamp = GST_CLOCK_TIME_NONE;
+ pts = MPEGTIME_TO_GSTTIME (demux->next_pts);
+ if (G_UNLIKELY (demux->next_dts != G_MAXUINT64))
+ dts = MPEGTIME_TO_GSTTIME (demux->next_dts);
if (demux->current_scr != G_MAXUINT64) {
GstClockTime cur_scr_time = MPEGTIME_TO_GSTTIME (demux->current_scr);
@@ -456,12 +456,14 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
}
/* OK, sent new segment now prepare the buffer for sending */
- GST_BUFFER_TIMESTAMP (buf) = timestamp;
+ GST_BUFFER_PTS (buf) = pts;
+ GST_BUFFER_DTS (buf) = dts;
/* Set the buffer discont flag, and clear discont state on the stream */
if (stream->discont) {
GST_DEBUG_OBJECT (demux, "discont buffer to pad %" GST_PTR_FORMAT
- " with TS %" GST_TIME_FORMAT, stream->pad, GST_TIME_ARGS (timestamp));
+ " with PTS %" GST_TIME_FORMAT " DTS %" GST_TIME_FORMAT,
+ stream->pad, GST_TIME_ARGS (pts), GST_TIME_ARGS (dts));
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
stream->discont = FALSE;
@@ -472,9 +474,9 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
demux->next_dts = G_MAXUINT64;
result = gst_pad_push (stream->pad, buf);
- GST_DEBUG_OBJECT (demux, "pushed stream id 0x%02x type 0x%02x, time: %"
+ GST_DEBUG_OBJECT (demux, "pushed stream id 0x%02x type 0x%02x, pts time: %"
GST_TIME_FORMAT ", size %d. result: %s",
- stream->id, stream->type, GST_TIME_ARGS (timestamp),
+ stream->id, stream->type, GST_TIME_ARGS (pts),
size, gst_flow_get_name (result));
return result;