playback/player: Stop using GSlice for allocations, it's deprecated soon and slower than malloc in most places

This commit is contained in:
Sebastian Dröge 2015-03-06 09:38:16 +01:00
parent 8b41422c77
commit 8ba8714b20

View file

@ -196,7 +196,7 @@ on_video_dimensions_changed (GstPlayer * unused, gint width, gint height,
static void static void
native_new (JNIEnv * env, jobject thiz) native_new (JNIEnv * env, jobject thiz)
{ {
Player *player = g_slice_new0 (Player); Player *player = g_new0 (Player, 1);
player->player = gst_player_new (); player->player = gst_player_new ();
SET_CUSTOM_DATA (env, thiz, native_player_field_id, player); SET_CUSTOM_DATA (env, thiz, native_player_field_id, player);
@ -226,7 +226,7 @@ native_free (JNIEnv * env, jobject thiz)
return; return;
(*env)->DeleteGlobalRef (env, player->java_player); (*env)->DeleteGlobalRef (env, player->java_player);
g_slice_free (Player, player); g_free (player);
SET_CUSTOM_DATA (env, thiz, native_player_field_id, NULL); SET_CUSTOM_DATA (env, thiz, native_player_field_id, NULL);
} }