Fix AudioEffect error.
authorcoderhyme <jhyo.kim@samsung.com>
Mon, 6 Mar 2017 00:51:34 +0000 (09:51 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 6 Mar 2017 01:57:40 +0000 (17:57 -0800)
Fixed not to throw an exception when it is not supported.

Change-Id: I6f942ce4e31009433549418c436c16e4094511e2
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia/Player/AudioEffect.cs

index afd95b9..e124c0a 100644 (file)
@@ -26,13 +26,19 @@ namespace Tizen.Multimedia
 
         internal AudioEffect(Player owner)
         {
-            Log.Debug(PlayerLog.Tag, PlayerLog.Enter);
             Player = owner;
 
             bool available = false;
             int ret = Interop.Player.AudioEffectEqualizerIsAvailable(Player.GetHandle(), out available);
             PlayerErrorConverter.ThrowIfError(ret, "Failed to initialize the AudioEffect");
 
+            IsAvailable = available;
+
+            if (IsAvailable == false)
+            {
+                return;
+            }
+
             int count = 0;
             ret = Interop.Player.AudioEffectGetEqualizerBandsCount(Player.GetHandle(), out count);
             PlayerErrorConverter.ThrowIfError(ret, "Failed to initialize the AudioEffect");
@@ -42,13 +48,11 @@ namespace Tizen.Multimedia
             ret = Interop.Player.AudioEffectGetEqualizerLevelRange(Player.GetHandle(), out min, out max);
             PlayerErrorConverter.ThrowIfError(ret, "Failed to initialize the AudioEffect");
 
-            IsAvailable = available;
             Count = count;
             MinBandLevel = min;
             MaxBandLevel = max;
 
             _bands = new EqualizerBand[count];
-            Log.Debug(PlayerLog.Tag, "available : " + available + ", count : " + count + ", min : " + min + ", max : " + max);
         }
 
         /// <summary>