Example #1
0
// Index returns the position of the given media in the list.
//
// Note: MediaList.Lock() SHOULD be held upon entering this function.
func (this *MediaList) Index(m *Media) (int, error) {
	if this.ptr == nil || m.ptr == nil {
		return 0, os.EINVAL
	}

	return int(C.libvlc_media_list_index_of_item(this.ptr, m.ptr)), checkError()
}
Example #2
0
// Index returns the position of the given media in the list.
//
// Note: MediaList.Lock() SHOULD be held upon entering this function.
func (this *MediaList) Index(m *Media) (int, error) {
	if this.ptr == nil {
		return 0, &VLCError{"MediaList is nil"}
	}
	if m.ptr == nil {
		return 0, &VLCError{"Media is nil"}
	}

	return int(C.libvlc_media_list_index_of_item(this.ptr, m.ptr)), checkError()
}