if (media_packet_create_alloc(pool_handle->fmt_h, _packet_finalize_cb, pool_handle, &pool_handle->packet[pool_handle->curr_pool_size]) != MEDIA_PACKET_ERROR_NONE) {
LOGE("The media packet pool is full or out of memory...");
+ g_mutex_unlock(&pool_handle->mutex);
return MEDIA_PACKET_ERROR_INVALID_OPERATION;
}
packet = pool_handle->packet[pool_handle->curr_pool_size];
packet = g_queue_pop_head(pool_handle->queue);
if (packet == NULL) {
+ g_mutex_unlock(&pool_handle->mutex);
LOGE("Failed to get packet handle from Queue "); //LCOV_EXCL_LINE
return MEDIA_PACKET_ERROR_INVALID_OPERATION;
}