MMPLAYER_ELEMENT_SET_STATE(new_element, GST_STATE_PLAYING);
}
+ if (caps)
+ gst_caps_unref(caps);
+
MMPLAYER_FLEAVE();
return;
gst_object_unref(GST_OBJECT(sinkpad));
if (caps)
- gst_object_unref(GST_OBJECT(caps));
+ gst_caps_unref(caps);
/* FIXIT : how to inform this error to MSL ????? */
/* FIXIT : I think we'd better to use g_idle_add() to destroy pipeline and
caps = gst_pad_query_caps(pad, NULL);
if (!caps) {
LOGE("failed to get caps from pad[%s:%s]", GST_DEBUG_PAD_NAME(pad));
- goto ERROR;
+ return ret;
}
str = gst_caps_get_structure(caps, 0);
if (MMPLAYER_IS_MS_BUFF_SRC(player)) {
__mmplayer_gst_decode_callback(elem, pad, player);
- return;
+ goto DONE;
}
LOGD("video selector \n");
if (MMPLAYER_IS_MS_BUFF_SRC(player)) {
__mmplayer_gst_decode_callback(elem, pad, player);
- return;
+ goto DONE;
}
LOGD("audio selector \n");
GstPad* srcpad = NULL;
GstPad* sinkpad = NULL;
+ GstCaps* caps = NULL;
gchar* caps_str = NULL;
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(player && player->pipeline && player->pipeline->mainbin);
- caps_str = gst_caps_to_string(gst_pad_get_current_caps(pad));
+ caps = gst_pad_get_current_caps(pad);
+ caps_str = gst_caps_to_string(caps);
LOGD("deinterleave new caps : %s\n", caps_str);
MMPLAYER_FREEIF(caps_str);
+ gst_caps_unref(caps);
if ((queue = __mmplayer_element_create_and_link(player, pad, "queue")) == NULL) {
LOGE("ERROR : queue create error\n");
MMPLAYER_LOG_GST_CAPS_TYPE(caps);
__mmplayer_set_audio_attrs(player, caps);
+ gst_caps_unref(caps);
}
MMPLAYER_FREEIF(change_pad_name);
}
(gpointer)player);
MMPLAYER_FLEAVE();
- return ;
+ return;
ERROR:
LOGE("__mmplayer_gst_audio_deinterleave_pad_added ERROR\n");
g_object_set(G_OBJECT(element), "timeout", http_timeout, NULL);
g_object_set(G_OBJECT(element), "blocksize", (unsigned long)(64*1024), NULL);
- /* check if prosy is vailid or not */
+ /* check if proxy is valid or not */
if (util_check_valid_url(proxy))
g_object_set(G_OBJECT(element), "proxy", proxy, NULL);
/* parsing cookies */
ret = __gst_handle_library_error(player, error->code);
else if (error->domain == GST_CORE_ERROR)
ret = __gst_handle_core_error(player, error->code);
+
+ g_error_free(error);
}
player->msg_posted = TRUE;
}
return MM_ERROR_NONE;
}
-
-
int
_mmplayer_set_mute(MMHandleType hplayer, int mute)
{
MMPLAYER_FREEIF(player->type);
player->type = gst_caps_to_string(caps);
if (player->type)
- LOGD("meida type %s found, probability %d%% / %d\n", player->type, probability, gst_caps_get_size(caps));
+ LOGD("media type %s found, probability %d%% / %d\n", player->type, probability, gst_caps_get_size(caps));
if ((!MMPLAYER_IS_RTSP_STREAMING(player)) &&
(g_strrstr(player->type, "audio/x-raw-int"))) {
LOGD("pad removed caps : %s from %s", caps_str, GST_ELEMENT_NAME(elem));
MMPLAYER_FREEIF(caps_str);
+ gst_caps_unref(caps);
}
}
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
MMPLAYER_RETURN_VAL_IF_FAIL(message, FALSE);
- s = malloc(sizeof(GstStructure));
- if (s == NULL) {
- LOGE("failed to alloc data.");
- return FALSE;
- }
+ s = gst_structure_copy(gst_message_get_structure(message));
- memcpy(s, gst_message_get_structure(message), sizeof(GstStructure));
if (!gst_structure_get_uint(s, "error_id", &error_id))
error_id = MMPLAYER_STREAMING_ERROR_NONE;
break;
default:
{
- MMPLAYER_FREEIF(s);
+ gst_structure_free(s);
return MM_ERROR_PLAYER_STREAMING_FAIL;
}
}
} else
LOGD("skip error post because it's sent already.\n");
- MMPLAYER_FREEIF(s);
+ gst_structure_free(s);
MMPLAYER_FLEAVE();
g_free(error_string);
{
MMPLAYER_RETURN_IF_FAIL(player);
-
/* post now if delay is zero */
if (delay_in_ms == 0 || player->set_mode.pcm_extraction) {
LOGD("eos delay is zero. posting EOS now\n");