webrtc_source: Add condition to return payload type when destroying source 94/315094/2 accepted/tizen/unified/20240727.112747 accepted/tizen/unified/dev/20240730.010453 accepted/tizen/unified/x/20240729.014256
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2024 03:10:07 +0000 (12:10 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2024 04:02:22 +0000 (13:02 +0900)
It is to avoid printing error log in some cases.

[Version] 1.1.18
[Issue Type] Improvement

Change-Id: Idcfcbe670afb1530bdb3d8cabca3f2cfce6d8e9d
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_source.c

index 29030ca91ec535f2263eab557a6d9f56c336dbcc..127303db9f490feaa53cab05b230aaaf08c3d69c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    1.1.17
+Version:    1.1.18
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 5716abe6cf0d91ec44a458a4e452bf0f412c0067..059bc22695d63aaf5e521ebd28184a08228c2bdf 100644 (file)
@@ -664,6 +664,7 @@ void _source_slot_destroy_cb(gpointer data)
        webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)data;
        int i;
        int j;
+       unsigned int pt;
 
        RET_IF(source == NULL, "source is NULL");
 
@@ -682,8 +683,9 @@ void _source_slot_destroy_cb(gpointer data)
                _remove_probe_from_pad_for_pause(source, i);
                _remove_probe_from_pad_for_render(source, i);
 
-               if (source->av[i].pt > 0)
-                       _return_payload_type(source->webrtc, source->av[i].pt);
+               pt = source->av[i].pt;
+               if (pt >= MIN_DYNAMIC_PAYLOAD_TYPE && !source->av[i].pt_set_by_api)
+                       _return_payload_type(source->webrtc, pt);
 
                _destroy_looopback_render_pipeline(source, i);
 
@@ -698,8 +700,9 @@ void _source_slot_destroy_cb(gpointer data)
                g_free(source->av[i].payloader_factory_name);
 
                for (j = 0; j < source->av[i].num_of_codecs; j++) {
-                       if (source->av[i].multiple_codecs[j].pt > 0)
-                               _return_payload_type(source->webrtc, source->av[i].multiple_codecs[j].pt);
+                       pt = source->av[i].multiple_codecs[j].pt;
+                       if (pt >= MIN_DYNAMIC_PAYLOAD_TYPE && !source->av[i].multiple_codecs[j].pt_set_by_api)
+                               _return_payload_type(source->webrtc, pt);
                }
        }