diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index 816b7ab..62d6080 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -1360,8 +1360,9 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event)
       /* If we STILL have zero frames processed, fire an error */
       if (parse->priv->framecount == 0 && !parse->priv->saw_gaps &&
           !parse->priv->first_buffer) {
-        GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE,
-            ("No valid frames found before end of stream"), (NULL));
+      /*  GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE,
+            ("No valid frames found before end of stream"), (NULL));*/
+        GST_ERROR_OBJECT(parse, "No valid frames decoded before end of stream");
       }
 
       if (!parse->priv->saw_gaps


diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index 3a59ef3..6958344 100644
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
@@ -1510,7 +1510,7 @@ main (int argc, char *argv[])
   g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
   g_option_context_add_group (ctx, gst_init_get_option_group ());
   if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
-    g_printerr ("Error initializing: %s\n", err->message);
+    g_printerr ("Error initializing: %s\n", err ? err->message : "(null)");
     g_clear_error (&err);
     g_option_context_free (ctx);
     return -1;


diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index 62d6080..2f83707 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -3170,6 +3170,7 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
         parse->priv->discont = TRUE;
       }
     }
+    GST_BUFFER_FLAG_UNSET(buffer, GST_BUFFER_FLAG_DISCONT);
     gst_adapter_push (parse->priv->adapter, buffer);
   }
 


diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
old mode 100644
new mode 100755
index 2f83707..a7f01ea
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -3151,6 +3151,21 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
             && parse->priv->passthrough)) {
       GstBaseParseFrame frame;
 
+    av = gst_adapter_available (parse->priv->adapter);
+    if (av) {
+      tmpbuf = gst_adapter_take_buffer (parse->priv->adapter, av);
+
+      if (parse->priv->upstream_format == GST_FORMAT_TIME) {
+        tmpbuf = gst_buffer_make_writable (tmpbuf);
+        GST_BUFFER_PTS (tmpbuf) = parse->priv->next_pts;
+        GST_BUFFER_DTS (tmpbuf) = parse->priv->next_dts;
+        GST_BUFFER_DURATION (tmpbuf) = GST_CLOCK_TIME_NONE;
+      }
+
+      ret = gst_pad_push (parse->srcpad, tmpbuf);
+
+    }
+
       gst_base_parse_frame_init (&frame);
       frame.buffer = gst_buffer_make_writable (buffer);
       ret = gst_base_parse_push_frame (parse, &frame);



diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index 5d1d65e..e4f1348 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -777,7 +777,7 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
     }
 
     cur_running_time = GST_CLOCK_TIME_NONE;
-    if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK) {
+    if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK || active_selpad->eos) {
       clock = gst_element_get_clock (GST_ELEMENT_CAST (sel));
       if (clock) {
         GstClockTime base_time;
@@ -828,7 +828,13 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
           "Waiting for active streams to advance. %" GST_TIME_FORMAT " >= %"
           GST_TIME_FORMAT, GST_TIME_ARGS (running_time),
           GST_TIME_ARGS (cur_running_time));
-      GST_INPUT_SELECTOR_WAIT (sel);
+      if (active_selpad->eos) {
+        GST_INPUT_SELECTOR_UNLOCK (sel);
+        g_usleep (5000);
+        GST_INPUT_SELECTOR_LOCK (sel);
+      } else {
+        GST_INPUT_SELECTOR_WAIT (sel);
+      }
     } else {
       GST_INPUT_SELECTOR_UNLOCK (sel);
       break;


diff --git a/gst/gstpoll.c b/gst/gstpoll.c
index 23bceab..f9f5242 100644
--- a/gst/gstpoll.c
+++ b/gst/gstpoll.c
@@ -1239,6 +1239,58 @@ gst_poll_fd_can_read (const GstPoll * set, GstPollFD * fd)
   return res;
 }
 
+static gboolean
+gst_poll_fd_can_read_pri_unlocked (const GstPoll * set, GstPollFD * fd)
+{
+  gboolean res = FALSE;
+  gint idx;
+
+  idx = find_index (set->active_fds, fd);
+  if (idx >= 0) {
+#ifndef G_OS_WIN32
+    struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, idx);
+
+    res = (pfd->revents & POLLPRI) != 0;
+#else
+    WinsockFd *wfd = &g_array_index (set->active_fds, WinsockFd, idx);
+
+    res = (wfd->events.lNetworkEvents & FD_ACCEPT) != 0;
+#endif
+  } else {
+    GST_WARNING ("%p: couldn't find fd !", set);
+  }
+  GST_DEBUG ("%p: fd (fd:%d, idx:%d) %d", set, fd->fd, fd->idx, res);
+
+  return res;
+}
+
+/**
+ * gst_poll_fd_can_read_pri:
+ * @set: a file descriptor set.
+ * @fd: a file descriptor.
+ *
+ * Check if @fd in @set has data to be read.
+ *
+ * Returns: %TRUE if the descriptor has data to be read.
+ */
+gboolean
+gst_poll_fd_can_read_pri (const GstPoll * set, GstPollFD * fd)
+{
+  gboolean res = FALSE;
+
+  g_return_val_if_fail (set != NULL, FALSE);
+  g_return_val_if_fail (fd != NULL, FALSE);
+  g_return_val_if_fail (fd->fd >= 0, FALSE);
+
+  g_mutex_lock (&((GstPoll *) set)->lock);
+
+  res = gst_poll_fd_can_read_pri_unlocked (set, fd);
+
+  g_mutex_unlock (&((GstPoll *) set)->lock);
+
+  return res;
+}
+
 /**
  * gst_poll_fd_can_write:
  * @set: a file descriptor set.
diff --git a/gst/gstpoll.h b/gst/gstpoll.h
index ef6dcea..0513648 100644
--- a/gst/gstpoll.h
+++ b/gst/gstpoll.h
@@ -79,6 +79,7 @@ void            gst_poll_fd_ignored       (GstPoll *set, GstPollFD *fd);
 gboolean        gst_poll_fd_has_closed    (const GstPoll *set, GstPollFD *fd);
 gboolean        gst_poll_fd_has_error     (const GstPoll *set, GstPollFD *fd);
 gboolean        gst_poll_fd_can_read      (const GstPoll *set, GstPollFD *fd);
+gboolean        gst_poll_fd_can_read_pri  (const GstPoll *set, GstPollFD *fd);
 gboolean        gst_poll_fd_can_write     (const GstPoll *set, GstPollFD *fd);
 
 gint            gst_poll_wait             (GstPoll *set, GstClockTime timeout);



diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index e4f1348..4eb5980 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -169,6 +169,7 @@ struct _GstSelectorPad
   guint32 segment_seqnum;       /* sequence number of the current segment */
 
   gboolean events_pending;      /* TRUE if sticky events need to be updated */
+  gboolean flush_events_pending;/* unblock old active track */
 
   gboolean sending_cached_buffers;
   GQueue *cached_buffers;
@@ -347,6 +348,7 @@ gst_selector_pad_reset (GstSelectorPad * pad)
   pad->eos = FALSE;
   pad->eos_sent = FALSE;
   pad->events_pending = FALSE;
+  pad->flush_events_pending = FALSE;
   pad->discont = FALSE;
   pad->flushing = FALSE;
   gst_segment_init (&pad->segment, GST_FORMAT_UNDEFINED);
@@ -565,6 +567,8 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
       selpad->flushing = TRUE;
       sel->eos = FALSE;
       selpad->group_done = FALSE;
+      if (selpad->flush_events_pending)
+        forward = TRUE;
       GST_INPUT_SELECTOR_BROADCAST (sel);
       break;
     case GST_EVENT_FLUSH_STOP:
@@ -1141,6 +1145,7 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
     buf = gst_buffer_ref (buf);
   res = gst_pad_push (sel->srcpad, buf);
   GST_LOG_OBJECT (pad, "Buffer %p forwarded result=%d", buf, res);
+  selpad->flush_events_pending = FALSE;
 
   GST_INPUT_SELECTOR_LOCK (sel);
 
@@ -1394,8 +1399,12 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GstPad * pad)
   active_pad_p = &self->active_sinkpad;
   gst_object_replace ((GstObject **) active_pad_p, GST_OBJECT_CAST (pad));
 
-  if (old && old != new)
+  if (old && old != new) {
     gst_pad_push_event (GST_PAD_CAST (old), gst_event_new_reconfigure ());
+    /* Old will be blocked on gst_pad_push() when set active pad in PAUSE
+     * state. Need flush when set active pad and then seek in PAUSE state */
+    old->flush_events_pending = TRUE;
+  }
   if (new)
     gst_pad_push_event (GST_PAD_CAST (new), gst_event_new_reconfigure ());
 

