[MediaPlayer] Fix not to set callback in case of using MedaiStreamSource (#529)
authornam <36914158+kqjy777@users.noreply.github.com>
Tue, 6 Nov 2018 01:04:18 +0000 (10:04 +0900)
committerGitHub <noreply@github.com>
Tue, 6 Nov 2018 01:04:18 +0000 (10:04 +0900)
* [MediaPlayer] Fix not to set callback in case of using MedaiStreamSource

when source is MediaStreamSource, ObjectKeeper is not active.
so garbage collector sometimes collects callback in use.
this patch is to avoid that case.

* fix not to set cb for case of MediaStreamSource

* fix to follow coding rules

src/Tizen.Multimedia.MediaPlayer/Player/Player.cs

index 99ea828..46d9a72 100644 (file)
@@ -586,12 +586,12 @@ namespace Tizen.Multimedia
 
             using (var cbKeeper = ObjectKeeper.Get(cb))
             {
-                NativeSetPlayPosition(position, accurate, nanoseconds, cb);
+                NativeSetPlayPosition(position, accurate, nanoseconds, immediateResult ? null : cb);
+
                 if (immediateResult)
                 {
                     taskCompletionSource.TrySetResult(true);
                 }
-
                 await taskCompletionSource.Task;
             }
         }