+int
+_mmplayer_get_track_index(mmplayer_t *player, mmplayer_track_type_e type, void* stream, int *index)
+{
+ guint found_index = 0;
+
+ MMPLAYER_FENTER();
+ MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+ MMPLAYER_RETURN_VAL_IF_FAIL(type < MM_PLAYER_TRACK_TYPE_MAX, MM_ERROR_INVALID_ARGUMENT);
+ MMPLAYER_RETURN_VAL_IF_FAIL(index, MM_ERROR_INVALID_ARGUMENT);
+
+ if (g_ptr_array_find(player->track[type].streams, stream, &found_index)) {
+ LOGD("Find same stream (%u)", found_index);
+ *index = (int)found_index;
+ return MM_ERROR_NONE;
+ }
+
+ *index = INVALID_TRACK_INDEX;
+ LOGD("Stream not found : type %d, stream %p", type, stream);
+ return MM_ERROR_PLAYER_INTERNAL;
+}
+
+static gboolean
+__mmplayer_stream_equal(gconstpointer stream1, gconstpointer stream2)
+{
+ return (g_strcmp0(gst_stream_get_stream_id((GstStream *)stream1),
+ gst_stream_get_stream_id((GstStream *)stream2)) == 0);
+}
+