[WebRTC] Remove wrong state check code (#3500)
authorHaesu Gwon <haesu.gwon@samsung.com>
Mon, 6 Sep 2021 02:29:31 +0000 (11:29 +0900)
committerGitHub <noreply@github.com>
Mon, 6 Sep 2021 02:29:31 +0000 (11:29 +0900)
src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSource.cs

index 99da490..0f54275 100755 (executable)
@@ -225,8 +225,6 @@ namespace Tizen.Multimedia.Remoting
                 throw new ArgumentException("Audio is not configured with the current source.");
             }
 
-            WebRtc.ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing);
-
             NativeWebRTC.PushMediaPacket(WebRtc.Handle, SourceId.Value, packet.GetHandle()).
                 ThrowIfFailed("Failed to push the packet to the WebRTC");
         }
@@ -235,22 +233,20 @@ namespace Tizen.Multimedia.Remoting
         {
             if (mediaFormat == null)
             {
-                Log.Warn(WebRTCLog.Tag, "invalid media format");
+                return;
+            }
+
+            IntPtr ptr = IntPtr.Zero;
+
+            try
+            {
+                ptr = mediaFormat.AsNativeHandle();
+                NativeWebRTC.SetMediaPacketSourceInfo(WebRtc.Handle, SourceId.Value, ptr).
+                    ThrowIfFailed("Failed to set the media stream info");
             }
-            else
+            finally
             {
-                IntPtr ptr = IntPtr.Zero;
-
-                try
-                {
-                    ptr = mediaFormat.AsNativeHandle();
-                    NativeWebRTC.SetMediaPacketSourceInfo(WebRtc.Handle, SourceId.Value, ptr).
-                        ThrowIfFailed("Failed to set the media stream info");
-                }
-                finally
-                {
-                    MediaFormat.ReleaseNativeHandle(ptr);
-                }
+                MediaFormat.ReleaseNativeHandle(ptr);
             }
         }