Fix for 4084134 End transition applied on image does not show up in previewer when playback

Change-Id: I72ee9fe95f038c07b6ccfe3305aa6436e882eedf
diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp
index e655daa..51ad51a 100644
--- a/libvideoeditor/lvpp/PreviewPlayer.cpp
+++ b/libvideoeditor/lvpp/PreviewPlayer.cpp
@@ -511,9 +511,24 @@
         return OK;
     }
 
+    // If new video source is not dummy, then always change source
+    // Else audio player continues using old audio source and there are
+    // frame drops to maintain AV sync
+    sp<MetaData> meta;
+    if (mVideoSource != NULL) {
+        meta = mVideoSource->getFormat();
+        const char *pVidSrcType;
+        if (meta->findCString(kKeyDecoderComponent, &pVidSrcType)) {
+            if (strcmp(pVidSrcType, "DummyVideoSource") != 0) {
+                LOGV(" Video clip with silent audio; need to change source");
+                return OK;
+            }
+        }
+    }
+
     const char *pSrcType1;
     const char *pSrcType2;
-    sp<MetaData> meta = anAudioSource->getFormat();
+    meta = anAudioSource->getFormat();
 
     if (meta->findCString(kKeyDecoderComponent, &pSrcType1)) {
         if (strcmp(pSrcType1, "DummyAudioSource") == 0) {