commit 9f3ef865a75d133e6d919e66cdd9bd47431060bf
Author: Song Bing <b06498@freescale.com>
Date:   Wed Sep 17 17:26:43 2014 +0800

    basesink: preroll issue for some clips which audio is shorter than video
    
    basesink hasn't call do_preroll when received GAP event which
    position is out of segment.
    call it when received GAP event.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736655
    
    Signed-off-by: Song Bing <b06498@freescale.com>

diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index 9fcacd6..f0664ad 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -1857,6 +1857,8 @@ again:
       case GST_EVENT_GAP:
       {
         GstClockTime timestamp, duration;
+        GstFlowReturn ret;
+
         gst_event_parse_gap (event, &timestamp, &duration);
 
         GST_DEBUG_OBJECT (basesink, "Got Gap time %" GST_TIME_FORMAT
@@ -1869,6 +1871,13 @@ again:
             stop = start + duration;
         }
         *do_sync = TRUE;
+
+        /* do preroll here as GAP events after one track reached EOS is 
+         * non syncable object and no chance to call do_preroll. */
+        ret = gst_base_sink_do_preroll (basesink, obj);
+        if (G_UNLIKELY (ret != GST_FLOW_OK))
+          goto preroll_failed;
+
         break;
       }
       default:
@@ -1986,6 +1995,12 @@ out_of_segment:
     GST_LOG_OBJECT (basesink, "buffer skipped, not in segment");
     return FALSE;
   }
+
+preroll_failed:
+  {
+    GST_DEBUG_OBJECT (basesink, "preroll failed");
+    return FALSE;
+  }
 }
 
 /* with STREAM_LOCK, PREROLL_LOCK, LOCK
