[UTC][webrtc][non-ACR] Fix redundant unreffing media packet 89/316289/1
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 04:39:28 +0000 (13:39 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 04:39:28 +0000 (13:39 +0900)
Change-Id: I174cb15661795f3d981af52ba6f9339fef78bb38
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/utc/webrtc/utc-media-webrtc.c

index 299347a15dfd2530ca7466846e344cbcd403768a..62b44c45a7ab2a6faa43395fa45571b54a6ab1db 100644 (file)
@@ -1738,11 +1738,11 @@ int utc_media_webrtc_media_packet_source_push_packet_p(void)
        ret = media_packet_new_alloc(format, NULL, NULL, &packet);
        assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
 
+       /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
        ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
        assert_eq(ret, WEBRTC_ERROR_NONE);
 
        media_format_unref(format);
-       media_packet_unref(packet);
 
        return 0;
 }
@@ -1778,11 +1778,11 @@ int utc_media_webrtc_media_packet_source_push_packet_n1(void)
        ret = media_packet_new_alloc(format, NULL, NULL, &packet);
        assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
 
+       /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
        ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
        assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
 
        media_format_unref(format);
-       media_packet_unref(packet);
 
        return 0;
 }
@@ -1822,11 +1822,11 @@ int utc_media_webrtc_media_packet_source_push_packet_n2(void)
        ret = media_packet_new_alloc(format, NULL, NULL, &packet);
        assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
 
+       /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
        ret = webrtc_media_packet_source_push_packet(g_webrtc, id + 1, packet);
        assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
 
        media_format_unref(format);
-       media_packet_unref(packet);
 
        return 0;
 }
@@ -1862,11 +1862,11 @@ int utc_media_webrtc_media_packet_source_push_packet_n3(void)
        ret = media_packet_new_alloc(format, NULL, NULL, &packet);
        assert_eq(ret, MEDIA_PACKET_ERROR_NONE);
 
+       /* NOTE: the function below takes ownership of the packet.(no need to unref the packet, or make sure to ref/unref pair). */
        ret = webrtc_media_packet_source_push_packet(g_webrtc, id, packet);
        assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
 
        media_format_unref(format);
-       media_packet_unref(packet);
 
        return 0;
 }