commit ba6d1cda8910a208b820a69aa8e56aa7b3e1243a
Author: Song Bing <b06498@freescale.com>
Date:   Wed Sep 17 17:35:29 2014 +0800

    basesink: preroll issue for some clips which audio is shorter than video
    
    send GAP event when streamsynchronizer change state from PLAYING
    to PAUSE for sink preroll.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736655
    
    Signed-off-by: Song Bing <b06498@freescale.com>

diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
index 3997d1b..6c03df6 100644
--- a/gst/playback/gststreamsynchronizer.c
+++ b/gst/playback/gststreamsynchronizer.c
@@ -838,6 +838,31 @@ gst_stream_synchronizer_change_state (GstElement * element,
     return ret;
 
   switch (transition) {
+    case GST_STATE_CHANGE_PLAYING_TO_PAUSED:{
+      GList *l;
+
+      GST_DEBUG_OBJECT (self, "State change PLAYING->PAUSED");
+      GST_STREAM_SYNCHRONIZER_LOCK (self);
+      for (l = self->streams; l; l = l->next) {
+        GstStream *ostream = l->data;
+        gint64 position;
+
+        if (!ostream->is_eos || ostream->segment.format != GST_FORMAT_TIME)
+          continue;
+
+        if (ostream->segment.position != -1)
+          position = ostream->segment.position;
+        else
+          position = ostream->segment.start;
+
+        if (position != -1) {
+          gst_pad_push_event (ostream->srcpad,
+              gst_event_new_gap (position, GST_CLOCK_TIME_NONE));
+        }
+      }
+      GST_STREAM_SYNCHRONIZER_UNLOCK (self);
+      break;
+    }
     case GST_STATE_CHANGE_PAUSED_TO_READY:{
       GList *l;
 
