MMFMWK-8218 subparse: fix critical log print out when set rate <0 with external subtitle
When playback with external subtitle, subparse will force its own start
and stop position when seek. When rate < 0, critial log will print out
assertion 'stop != -1', so need avoid it when rate < 0.
upstream status: Pending
https://bugzilla.gnome.org/show_bug.cgi?id=771648
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
index 06de459..82d9d5f 100644
--- a/gst/subparse/gstsubparse.c
+++ b/gst/subparse/gstsubparse.c
@@ -279,6 +279,11 @@
/* Convert that seek to a seeking in bytes at position 0,
FIXME: could use an index */
+ if (rate < 0) {
+ rate = 1.0;
+ GST_WARNING_OBJECT (self, "Only can push positive rate upstream");
+ }
+
ret = gst_pad_push_event (self->sinkpad,
gst_event_new_seek (rate, GST_FORMAT_BYTES, flags,
GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0));