summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux
diff options
context:
space:
mode:
authorVineeth TM <vineeth.tm@samsung.com>2015-12-24 15:36:54 +0900
committerSebastian Dröge <sebastian@centricular.com>2016-02-17 10:51:07 +0200
commitee8a5455d0b04198e90670ea672859cc30a1ad48 (patch)
tree336932c6bf85dbdd2d3fc9238bd761b04ca983b4 /gst/mpegtsdemux
parent6676ed6cb0d84173a2051aeb4f19209fb904e444 (diff)
downloadgstreamer-plugins-bad-ee8a5455d0b04198e90670ea672859cc30a1ad48.tar.gz
mpegtsbase: Refactor code to check for subclass seek handling
If subclass is not able to handle seek event, then there is no need to stop streaming and send flush events. We should simply return FALSE https://bugzilla.gnome.org/show_bug.cgi?id=758516
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r--gst/mpegtsdemux/mpegtsbase.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c
index 126566905..d63122f7c 100644
--- a/gst/mpegtsdemux/mpegtsbase.c
+++ b/gst/mpegtsdemux/mpegtsbase.c
@@ -1433,11 +1433,18 @@ mpegts_base_handle_seek_event (MpegTSBase * base, GstPad * pad,
}
base->mode = BASE_MODE_PUSHING;
}
+ } else {
+ GST_WARNING ("subclass has no seek implementation");
}
return ret == GST_FLOW_OK;
}
+ if (!klass->seek) {
+ GST_WARNING ("subclass has no seek implementation");
+ return FALSE;
+ }
+
if (rate <= 0.0) {
GST_WARNING ("Negative rate not supported");
return FALSE;
@@ -1484,16 +1491,11 @@ mpegts_base_handle_seek_event (MpegTSBase * base, GstPad * pad,
/* If the subclass can seek, do that */
- if (klass->seek) {
- ret = klass->seek (base, event);
- if (G_UNLIKELY (ret != GST_FLOW_OK))
- GST_WARNING ("seeking failed %s", gst_flow_get_name (ret));
- else
- base->last_seek_seqnum = GST_EVENT_SEQNUM (event);
- } else {
- /* FIXME : Check this before so we don't do seeks we can't handle ? */
- GST_WARNING ("subclass has no seek implementation");
- }
+ ret = klass->seek (base, event);
+ if (G_UNLIKELY (ret != GST_FLOW_OK))
+ GST_WARNING ("seeking failed %s", gst_flow_get_name (ret));
+ else
+ base->last_seek_seqnum = GST_EVENT_SEQNUM (event);
if (flush_event) {
/* if we sent a FLUSH_START, we now send a FLUSH_STOP */