Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
8b8565fb
Commit
8b8565fb
authored
Oct 11, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/media_list.c: Use the new array API.
parent
c08fa1c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
src/control/media_list.c
src/control/media_list.c
+23
-14
No files found.
src/control/media_list.c
View file @
8b8565fb
...
...
@@ -114,7 +114,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
vlc_mutex_init
(
p_inst
->
p_libvlc_int
,
&
p_mlist
->
object_lock
);
ARRAY_INIT
(
p_mlist
->
items
);
vlc_array_init
(
&
p_mlist
->
items
);
p_mlist
->
i_refcount
=
1
;
p_mlist
->
p_md
=
NULL
;
...
...
@@ -129,6 +129,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
void
libvlc_media_list_release
(
libvlc_media_list_t
*
p_mlist
)
{
libvlc_media_descriptor_t
*
p_md
;
int
i
;
vlc_mutex_lock
(
&
p_mlist
->
object_lock
);
p_mlist
->
i_refcount
--
;
...
...
@@ -149,10 +150,14 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
if
(
p_mlist
->
p_md
)
libvlc_media_descriptor_release
(
p_mlist
->
p_md
);
FOREACH_ARRAY
(
p_md
,
p_mlist
->
items
)
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_mlist
->
items
);
i
++
)
{
p_md
=
vlc_array_object_at_index
(
&
p_mlist
->
items
,
i
);
libvlc_media_descriptor_release
(
p_md
);
FOREACH_END
()
}
vlc_array_clear
(
&
p_mlist
->
items
);
free
(
p_mlist
);
}
...
...
@@ -259,7 +264,7 @@ int libvlc_media_list_count( libvlc_media_list_t * p_mlist,
libvlc_exception_t
*
p_e
)
{
(
void
)
p_e
;
return
p_mlist
->
items
.
i_size
;
return
vlc_array_count
(
&
p_mlist
->
items
)
;
}
/**************************************************************************
...
...
@@ -274,8 +279,8 @@ void libvlc_media_list_add_media_descriptor(
{
(
void
)
p_e
;
libvlc_media_descriptor_retain
(
p_md
);
ARRAY_INSERT
(
p_mlist
->
items
,
p_md
,
p_mlist
->
items
.
i_size
);
notify_item_addition
(
p_mlist
,
p_md
,
p_mlist
->
items
.
i_size
-
1
);
vlc_array_append
(
&
p_mlist
->
items
,
p_md
);
notify_item_addition
(
p_mlist
,
p_md
,
vlc_array_count
(
&
p_mlist
->
items
)
-
1
);
}
/**************************************************************************
...
...
@@ -292,7 +297,7 @@ void libvlc_media_list_insert_media_descriptor(
(
void
)
p_e
;
libvlc_media_descriptor_retain
(
p_md
);
ARRAY_INSERT
(
p_mlist
->
items
,
p_md
,
index
);
vlc_array_insert
(
&
p_mlist
->
items
,
p_md
,
index
);
notify_item_addition
(
p_mlist
,
p_md
,
index
);
}
...
...
@@ -307,9 +312,9 @@ void libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
{
libvlc_media_descriptor_t
*
p_md
;
p_md
=
ARRAY_VAL
(
p_mlist
->
items
,
index
);
p_md
=
vlc_array_object_at_index
(
&
p_mlist
->
items
,
index
);
ARRAY_REMOVE
(
p_mlist
->
items
,
index
)
vlc_array_remove
(
&
p_mlist
->
items
,
index
);
notify_item_deletion
(
p_mlist
,
p_md
,
index
);
libvlc_media_descriptor_release
(
p_md
);
...
...
@@ -325,7 +330,8 @@ libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
int
index
,
libvlc_exception_t
*
p_e
)
{
libvlc_media_descriptor_t
*
p_md
=
ARRAY_VAL
(
p_mlist
->
items
,
index
);
libvlc_media_descriptor_t
*
p_md
;
p_md
=
vlc_array_object_at_index
(
&
p_mlist
->
items
,
index
);
libvlc_media_descriptor_retain
(
p_md
);
return
p_md
;
}
...
...
@@ -341,10 +347,13 @@ int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
libvlc_exception_t
*
p_e
)
{
libvlc_media_descriptor_t
*
p_md
;
FOREACH_ARRAY
(
p_md
,
p_mlist
->
items
)
int
i
;
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_mlist
->
items
);
i
++
)
{
p_md
=
vlc_array_object_at_index
(
&
p_mlist
->
items
,
i
);
if
(
p_searched_md
==
p_md
)
return
fe_idx
;
/* Once more, we hate macro for that */
FOREACH_END
()
return
i
;
}
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment