From e5fd50a816f292ff3ca5d3b4c0e9f3eb7400f396 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Mon, 7 Aug 2017 13:14:21 +0900 Subject: [PATCH] fixed pvs issues Change-Id: I25db77a3ab066ea0a82c963a54af08021f20ae91 --- src/media_codec_port_gst.c | 7 ++++--- test/media_codec_test.c | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/media_codec_port_gst.c b/src/media_codec_port_gst.c index 83ab219..daa574f 100644 --- a/src/media_codec_port_gst.c +++ b/src/media_codec_port_gst.c @@ -2421,7 +2421,10 @@ ERROR: void _mc_gst_handle_input_buffer_used(mc_gst_core_t *core, media_packet_h packet) { - g_atomic_int_dec_and_test(&core->etb_count); + if (core) { + g_atomic_int_dec_and_test(&core->etb_count); + LOGD("@v(%d)e(%d) input port used(%d)----- ", core->video, core->encoder, core->etb_count); + } if (core && core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER]) { ((mc_empty_buffer_cb)core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER]) @@ -2863,8 +2866,6 @@ static gint __gst_transform_gsterror(mc_gst_core_t *core, GstMessage *message, G break; } - return MEDIACODEC_ERROR_INVALID_STREAM; - INTERNAL_ERROR: return MEDIACODEC_ERROR_INTERNAL; } diff --git a/test/media_codec_test.c b/test/media_codec_test.c index 80e6c60..005d4f3 100644 --- a/test/media_codec_test.c +++ b/test/media_codec_test.c @@ -855,7 +855,7 @@ int _configure(App *app, int codecid, int flag, gboolean *hardware, media_forma void _mediacodec_process_input(App *app) { - gint i; + gint i, j; gboolean have_frame = FALSE; gint ret; static guint64 pts = 0L; @@ -902,7 +902,7 @@ void _mediacodec_process_input(App *app) media_packet_get_video_stride_width(pkt, 0, &stride_width); offset = app->width*app->height; - for (i = 0; i < app->height; i++) { + for (j = 0; j < app->height; j++) { memcpy(buf_data_ptr, tmp, app->width); buf_data_ptr += stride_width; tmp += app->width; @@ -913,7 +913,7 @@ void _mediacodec_process_input(App *app) media_packet_get_video_stride_width(pkt, 1, &stride_width); size = app->width * app->height / 2; - for (i = 0; i < app->height / 2; i++) { + for (j = 0; j < app->height / 2; j++) { memcpy(buf_data_ptr, tmp, app->width); buf_data_ptr += stride_width; tmp += app->width; @@ -924,7 +924,7 @@ void _mediacodec_process_input(App *app) media_packet_get_video_stride_width(pkt, 1, &stride_width); size = (app->width>>1) * (app->height>>1); - for (i = 0; i < app->height/2; i++) { + for (j = 0; j < app->height/2; j++) { memcpy(buf_data_ptr, tmp, app->width/2); buf_data_ptr += stride_width; tmp += app->width/2; @@ -935,7 +935,7 @@ void _mediacodec_process_input(App *app) media_packet_get_video_stride_width(pkt, 2, &stride_width); offset += size; - for (i = 0; i < app->height/2; i++) { + for (j = 0; j < app->height/2; j++) { memcpy(buf_data_ptr, tmp, app->width/2); buf_data_ptr += stride_width; tmp += app->width/2; -- 2.34.1