summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-11 11:51:50 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-12 17:03:37 +0200
commit20cd96f5c3c52f38bd81d837721be3598c3eb61e (patch)
treedcb937e4304fbf0376b1c3e54c4a52c8bf55934c /gst
parentaca6237b3ebccf04b5df4bbc07739f0ad998f541 (diff)
downloadgstreamer-plugins-bad-20cd96f5c3c52f38bd81d837721be3598c3eb61e.tar.gz
mpegdemux: refactor segment sending
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegdemux/gstmpegdemux.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index 8c21685cf..02219a78f 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -501,23 +501,10 @@ unknown_stream:
}
}
-static GstFlowReturn
-gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
- GstBuffer * buf)
+static inline void
+gst_flups_demux_send_segment (GstFluPSDemux * demux, GstFluPSStream * stream,
+ GstClockTime pts)
{
- GstFlowReturn result;
- GstClockTime pts = GST_CLOCK_TIME_NONE, dts = GST_CLOCK_TIME_NONE;
- guint size;
-
- if (stream == NULL)
- goto no_stream;
-
- /* timestamps */
- if (G_UNLIKELY (demux->next_pts != G_MAXUINT64))
- pts = MPEGTIME_TO_GSTTIME (demux->next_pts);
- if (G_UNLIKELY (demux->next_dts != G_MAXUINT64))
- dts = MPEGTIME_TO_GSTTIME (demux->next_dts);
-
/* discont */
if (G_UNLIKELY (stream->need_segment)) {
guint64 time, start, stop;
@@ -575,6 +562,26 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
stream->need_segment = FALSE;
}
+}
+
+static GstFlowReturn
+gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream,
+ GstBuffer * buf)
+{
+ GstFlowReturn result;
+ GstClockTime pts = GST_CLOCK_TIME_NONE, dts = GST_CLOCK_TIME_NONE;
+ guint size;
+
+ if (stream == NULL)
+ goto no_stream;
+
+ /* timestamps */
+ if (G_UNLIKELY (demux->next_pts != G_MAXUINT64))
+ pts = MPEGTIME_TO_GSTTIME (demux->next_pts);
+ if (G_UNLIKELY (demux->next_dts != G_MAXUINT64))
+ dts = MPEGTIME_TO_GSTTIME (demux->next_dts);
+
+ gst_flups_demux_send_segment (demux, stream, pts);
/* OK, sent new segment now prepare the buffer for sending */
GST_BUFFER_PTS (buf) = pts;