From: Sangchul Lee Date: Tue, 30 Mar 2021 05:46:41 +0000 (+0900) Subject: media_packet_pool: Revise media_packet_pool_set_media_format() X-Git-Tag: submit/tizen/20210330.080445^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdf1b0e33ee4751a87087e637aa1f237c4bdcafe;p=platform%2Fcore%2Fapi%2Fmediatool.git media_packet_pool: Revise media_packet_pool_set_media_format() Revise condition to validate format type. The commit 1fbba30197cb2a0a28a740ea3ed06a795a593ffc affects the previous condition, therefore it is fixed now. Fix invalid return value according to API description. [Version] 0.1.44 [Issue Type] Bug fix Change-Id: I898a3f56d6a4c7de2a87ef882ae18bbf2d6cdcc1 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-tool.spec b/packaging/capi-media-tool.spec index a1d8556..5626856 100755 --- a/packaging/capi-media-tool.spec +++ b/packaging/capi-media-tool.spec @@ -1,6 +1,6 @@ Name: capi-media-tool Summary: A Core API media tool library in Tizen Native API -Version: 0.1.43 +Version: 0.1.44 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_packet_pool.c b/src/media_packet_pool.c index 76514b9..01ce6f2 100644 --- a/src/media_packet_pool.c +++ b/src/media_packet_pool.c @@ -65,13 +65,16 @@ int media_packet_pool_set_media_format(media_packet_pool_h pool, media_format_h MEDIA_PACKET_POOL_NULL_ARG_CHECK(fmt); ret = media_format_get_type(fmt, &type); - if (ret == MEDIA_FORMAT_ERROR_INVALID_OPERATION || type == MEDIA_FORMAT_CONTAINER || type == MEDIA_FORMAT_TEXT) { - LOGE("Invaild media format"); - return MEDIA_PACKET_ERROR_INVALID_OPERATION; + if (ret != MEDIA_FORMAT_ERROR_NONE) { + LOGE("failed to media_format_get_type()"); + return MEDIA_PACKET_ERROR_INVALID_PARAMETER; + } + if (type != MEDIA_FORMAT_AUDIO && type != MEDIA_FORMAT_VIDEO) { + LOGE("invalid format type, type[0x%x]", type); + return MEDIA_PACKET_ERROR_INVALID_PARAMETER; } pool_handle = (media_packet_pool_s *)pool; - pool_handle->fmt_h = fmt; return ret;