Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
643f36a9
Commit
643f36a9
authored
Jun 04, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Fix a typo in a memcpy and constify.
Pointed by Laurent and Valgrind.
parent
8afeb01e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
12 deletions
+29
-12
src/control/media_list_path.h
src/control/media_list_path.h
+29
-12
No files found.
src/control/media_list_path.h
View file @
643f36a9
...
...
@@ -27,6 +27,23 @@
typedef
int
*
libvlc_media_list_path_t
;
/* (Media List Player Internal) */
/**************************************************************************
* path_dump (Media List Player Internal)
**************************************************************************/
static
inline
void
libvlc_media_list_path_dump
(
const
libvlc_media_list_path_t
path
)
{
if
(
!
path
)
{
printf
(
"NULL path
\n
"
);
return
;
}
int
i
;
for
(
i
=
0
;
path
[
i
]
!=
-
1
;
i
++
)
printf
(
"%s%d"
,
i
>
0
?
"/"
:
""
,
path
[
i
]);
printf
(
"
\n
"
);
}
/**************************************************************************
* path_empty (Media List Player Internal)
**************************************************************************/
...
...
@@ -51,7 +68,7 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_with_root_index( i
/**************************************************************************
* path_deepness (Media List Player Internal)
**************************************************************************/
static
inline
int
libvlc_media_list_path_de
epness
(
libvlc_media_list_path_t
path
)
static
inline
int
libvlc_media_list_path_de
pth
(
const
libvlc_media_list_path_t
path
)
{
int
i
;
for
(
i
=
0
;
path
[
i
]
!=
-
1
;
i
++
);
...
...
@@ -72,21 +89,21 @@ static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_p
/**************************************************************************
* path_copy_by_appending (Media List Player Internal)
**************************************************************************/
static
inline
libvlc_media_list_path_t
libvlc_media_list_path_copy_by_appending
(
libvlc_media_list_path_t
path
,
int
index
)
static
inline
libvlc_media_list_path_t
libvlc_media_list_path_copy_by_appending
(
const
libvlc_media_list_path_t
path
,
int
index
)
{
libvlc_media_list_path_t
ret
;
int
old_de
epness
=
libvlc_media_list_path_deepness
(
path
);
ret
=
malloc
(
sizeof
(
int
)
*
(
old_deepness
+
2
)
);
memcpy
(
ret
,
path
,
sizeof
(
int
)
*
(
old_deepness
+
2
)
);
ret
[
old_de
epness
]
=
index
;
ret
[
old_de
epness
+
1
]
=
-
1
;
int
old_de
pth
=
libvlc_media_list_path_depth
(
path
);
ret
=
malloc
(
sizeof
(
int
)
*
(
old_depth
+
2
)
);
memcpy
(
ret
,
path
,
sizeof
(
int
)
*
old_depth
);
ret
[
old_de
pth
]
=
index
;
ret
[
old_de
pth
+
1
]
=
-
1
;
return
ret
;
}
/**************************************************************************
* path_copy (Media List Player Internal)
**************************************************************************/
static
inline
libvlc_media_list_path_t
libvlc_media_list_path_copy
(
libvlc_media_list_path_t
path
)
static
inline
libvlc_media_list_path_t
libvlc_media_list_path_copy
(
const
libvlc_media_list_path_t
path
)
{
libvlc_media_list_path_t
ret
;
int
deepness
=
libvlc_media_list_path_deepness
(
path
);
...
...
@@ -99,7 +116,7 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy( libvlc_media
* get_path_rec (Media List Player Internal)
**************************************************************************/
static
libvlc_media_list_path_t
get_path_rec
(
libvlc_media_list_path_t
path
,
libvlc_media_list_t
*
p_current_mlist
,
libvlc_media_t
*
p_searched_md
)
get_path_rec
(
const
libvlc_media_list_path_t
path
,
libvlc_media_list_t
*
p_current_mlist
,
libvlc_media_t
*
p_searched_md
)
{
int
i
,
count
;
count
=
libvlc_media_list_count
(
p_current_mlist
,
NULL
);
...
...
@@ -143,7 +160,7 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_of_item( libvlc_me
* item_at_path (Media List Player Internal)
**************************************************************************/
static
libvlc_media_t
*
libvlc_media_list_item_at_path
(
libvlc_media_list_t
*
p_mlist
,
libvlc_media_list_path_t
path
)
libvlc_media_list_item_at_path
(
libvlc_media_list_t
*
p_mlist
,
const
libvlc_media_list_path_t
path
)
{
libvlc_media_list_t
*
p_current_mlist
=
p_mlist
;
libvlc_media_t
*
p_md
=
NULL
;
...
...
@@ -176,7 +193,7 @@ libvlc_media_list_item_at_path( libvlc_media_list_t * p_mlist, libvlc_media_list
* parentlist_at_path (Media List Player Internal)
**************************************************************************/
static
libvlc_media_list_t
*
libvlc_media_list_parentlist_at_path
(
libvlc_media_list_t
*
p_mlist
,
libvlc_media_list_path_t
path
)
libvlc_media_list_parentlist_at_path
(
libvlc_media_list_t
*
p_mlist
,
const
libvlc_media_list_path_t
path
)
{
libvlc_media_list_t
*
p_current_mlist
=
p_mlist
;
libvlc_media_t
*
p_md
=
NULL
;
...
...
@@ -209,7 +226,7 @@ libvlc_media_list_parentlist_at_path( libvlc_media_list_t * p_mlist, libvlc_medi
* sublist_at_path (Media List Player Internal)
**************************************************************************/
static
libvlc_media_list_t
*
libvlc_media_list_sublist_at_path
(
libvlc_media_list_t
*
p_mlist
,
libvlc_media_list_path_t
path
)
libvlc_media_list_sublist_at_path
(
libvlc_media_list_t
*
p_mlist
,
const
libvlc_media_list_path_t
path
)
{
libvlc_media_list_t
*
ret
;
libvlc_media_t
*
p_md
=
libvlc_media_list_item_at_path
(
p_mlist
,
path
);
...
...
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