webrtc_test: Fix deadlock issue 52/280152/3 submit/tizen/20220826.010121
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 24 Aug 2022 10:26:13 +0000 (19:26 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Aug 2022 05:52:42 +0000 (14:52 +0900)
Without stopping push packets to a media packet source and then
when trying to remove the source or to destroy webrtc handle,
it was blocked. This issue is fixed.

[Version] 0.3.214
[Issue Type] Bug fix

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

index f4ec95d9886e1bec90e4a5f6d95e81402cb16786..b7b5b9a26ec64733f168687e8f3152ecdebb6b84 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.213
+Version:    0.3.214
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c9c8a7918fce6143ca234eeb0ca450bd14436c71..fa8d1bc9174a62c8b9ed2abafae4c73945a18fd2 100644 (file)
@@ -76,6 +76,8 @@ static const char *g_webrtc_stats_type_str[] = {
 
 static appdata_s g_ad;
 
+static void _stop_pushing_packet(int index, int source_id);
+
 appdata_s *get_appdata(void)
 {
        return &g_ad;
@@ -124,12 +126,16 @@ static void __disconnect_signal(GObject *obj, gulong signal_id)
 
 static void __release_packet_source(int conn_idx, unsigned int source_idx)
 {
+       media_packet_source_s *packet_source;
+
        if (conn_idx < 0 || conn_idx >= MAX_CONNECTION_LEN)
                return;
        if (source_idx >= MAX_MEDIA_PACKET_SOURCE_LEN)
                return;
 
-       media_packet_source_s *packet_source = &g_ad.conns[conn_idx].packet_sources[source_idx];
+       packet_source = &g_ad.conns[conn_idx].packet_sources[source_idx];
+
+       _stop_pushing_packet(conn_idx, packet_source->source_id);
 
        packet_source->source_id = 0;
        if (packet_source->format) {