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
e2e0f4d6
Commit
e2e0f4d6
authored
Apr 12, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ALL: fixed a handful of bugs and memory leaks.
parent
35e0d027
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
37 deletions
+33
-37
modules/demux/playlist/b4s.c
modules/demux/playlist/b4s.c
+4
-1
modules/misc/xml/xtag.c
modules/misc/xml/xtag.c
+8
-17
src/input/stream.c
src/input/stream.c
+11
-14
src/playlist/item.c
src/playlist/item.c
+9
-3
src/playlist/playlist.c
src/playlist/playlist.c
+1
-2
No files found.
modules/demux/playlist/b4s.c
View file @
e2e0f4d6
...
...
@@ -154,7 +154,10 @@ static int Demux( demux_t *p_demux )
p_xml
=
p_sys
->
p_xml
=
xml_Create
(
p_demux
);
if
(
!
p_xml
)
return
-
1
;
stream_ReadLine
(
p_demux
->
s
);
psz_elname
=
stream_ReadLine
(
p_demux
->
s
);
if
(
psz_elname
)
free
(
psz_elname
);
psz_elname
=
0
;
p_xml_reader
=
xml_ReaderCreate
(
p_xml
,
p_demux
->
s
);
if
(
!
p_xml_reader
)
return
-
1
;
p_sys
->
p_xml_reader
=
p_xml_reader
;
...
...
modules/misc/xml/xtag.c
View file @
e2e0f4d6
...
...
@@ -166,31 +166,22 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *s )
{
xml_reader_t
*
p_reader
;
char
*
p_buffer
;
int
i_
pos
,
i_size
,
i_buffer
=
5000
;
int
i_
size
,
i_pos
=
0
,
i_buffer
=
2048
;
XTag
*
p_root
;
/* Open and read file */
p_buffer
=
malloc
(
i_buffer
+
1
);
if
(
p_buffer
==
NULL
)
return
NULL
;
p_buffer
=
malloc
(
i_buffer
);
if
(
p_buffer
==
NULL
)
return
NULL
;
i_pos
=
0
;
i_size
=
0
;
while
(
i_pos
<
i_buffer
)
while
(
(
i_size
=
stream_Read
(
s
,
&
p_buffer
[
i_pos
],
2048
)
)
==
2048
)
{
i_size
=
stream_Read
(
s
,
&
p_buffer
[
i_pos
],
5000
);
i_pos
+=
i_size
;
if
(
i_size
<
5000
)
break
;
/* we're done */
else
{
i_buffer
+=
5000
;
p_buffer
=
realloc
(
p_buffer
,
i_buffer
*
sizeof
(
char
*
)
);
}
i_buffer
+=
i_size
;
p_buffer
=
realloc
(
p_buffer
,
i_buffer
);
}
p_buffer
[
i_pos
]
=
0
;
p_buffer
[
i_pos
+
i_size
]
=
0
;
/* 0 terminated string */
if
(
!
i_buffer
)
if
(
i_pos
+
i_size
==
0
)
{
msg_Dbg
(
p_xml
,
"empty xml"
);
free
(
p_buffer
);
...
...
src/input/stream.c
View file @
e2e0f4d6
...
...
@@ -186,7 +186,7 @@ static int ASeek( stream_t *s, int64_t i_pos );
/****************************************************************************
* stream_
Access
New: create a stream from a access
* stream_
Url
New: create a stream from a access
****************************************************************************/
stream_t
*
__stream_UrlNew
(
vlc_object_t
*
p_parent
,
const
char
*
psz_url
)
{
...
...
@@ -194,32 +194,29 @@ stream_t *__stream_UrlNew( vlc_object_t *p_parent, const char *psz_url )
access_t
*
p_access
;
stream_t
*
p_res
;
if
(
!
psz_url
)
return
0
;
psz_dup
=
strdup
(
psz_url
);
MRLSplit
(
p_parent
,
psz_dup
,
&
psz_access
,
&
psz_demux
,
&
psz_path
);
/* Now try a real access */
p_access
=
access2_New
(
p_parent
,
psz_access
,
NULL
,
psz_path
,
VLC_FALSE
);
p_access
=
access2_New
(
p_parent
,
psz_access
,
psz_demux
,
psz_path
,
0
);
free
(
psz_dup
);
if
(
p_access
==
NULL
)
{
msg_Err
(
p_parent
,
"no suitable access module for `%s'"
,
psz_url
);
free
(
psz_dup
);
return
NULL
;
}
p_res
=
stream_AccessNew
(
p_access
,
VLC_TRUE
);
if
(
p_res
)
{
p_res
->
pf_destroy
=
UStreamDestroy
;
free
(
psz_dup
);
return
p_res
;
}
else
if
(
!
(
p_res
=
stream_AccessNew
(
p_access
,
VLC_TRUE
)
)
)
{
access2_Delete
(
p_access
);
return
NULL
;
}
free
(
psz_dup
);
return
NULL
;
p_res
->
pf_destroy
=
UStreamDestroy
;
return
p_res
;
}
stream_t
*
stream_AccessNew
(
access_t
*
p_access
,
vlc_bool_t
b_quick
)
...
...
src/playlist/item.c
View file @
e2e0f4d6
...
...
@@ -116,13 +116,17 @@ playlist_item_t *__playlist_ItemCopy( vlc_object_t *p_obj,
return
NULL
;
}
memcpy
(
p_res
,
p_item
,
sizeof
(
playlist_item_t
)
)
;
*
p_res
=
*
p_item
;
vlc_mutex_init
(
p_obj
,
&
p_res
->
input
.
lock
);
p_res
->
input
.
ppsz_options
=
malloc
(
p_item
->
input
.
i_options
*
sizeof
(
char
*
));
if
(
p_item
->
input
.
i_options
)
p_res
->
input
.
ppsz_options
=
malloc
(
p_item
->
input
.
i_options
*
sizeof
(
char
*
)
);
for
(
i
=
0
;
i
<
p_item
->
input
.
i_options
;
i
++
)
{
p_res
->
input
.
ppsz_options
[
i
]
=
strdup
(
p_item
->
input
.
ppsz_options
[
i
]
);
}
if
(
p_item
->
i_children
!=
-
1
)
{
msg_Warn
(
p_obj
,
"not copying playlist items children"
);
...
...
@@ -139,7 +143,8 @@ playlist_item_t *__playlist_ItemCopy( vlc_object_t *p_obj,
if
(
p_item
->
input
.
i_es
)
{
p_res
->
input
.
es
=
(
es_format_t
**
)
malloc
(
p_item
->
input
.
i_es
*
sizeof
(
es_format_t
*
));
p_res
->
input
.
es
=
(
es_format_t
**
)
malloc
(
p_item
->
input
.
i_es
*
sizeof
(
es_format_t
*
));
for
(
i
=
0
;
i
<
p_item
->
input
.
i_es
;
i
++
)
{
p_res
->
input
.
es
[
i
]
=
(
es_format_t
*
)
malloc
(
sizeof
(
es_format_t
*
));
...
...
@@ -329,6 +334,7 @@ int playlist_ItemSetName( playlist_item_t *p_item, char *psz_name )
{
if
(
psz_name
&&
p_item
)
{
if
(
p_item
->
input
.
psz_name
)
free
(
p_item
->
input
.
psz_name
);
p_item
->
input
.
psz_name
=
strdup
(
psz_name
);
return
VLC_SUCCESS
;
}
...
...
src/playlist/playlist.c
View file @
e2e0f4d6
...
...
@@ -120,7 +120,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
p_playlist
->
i_size
=
0
;
p_playlist
->
pp_items
=
NULL
;
p_playlist
->
i_all_size
=
0
;
p_playlist
->
pp_all_items
=
malloc
(
sizeof
(
playlist_item_t
*
))
;
p_playlist
->
pp_all_items
=
0
;
playlist_ViewInsert
(
p_playlist
,
VIEW_CATEGORY
,
TITLE_CATEGORY
);
playlist_ViewInsert
(
p_playlist
,
VIEW_SIMPLE
,
TITLE_SIMPLE
);
...
...
@@ -258,7 +258,6 @@ int playlist_LockControl( playlist_t * p_playlist, int i_query, ... )
va_end
(
args
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
i_result
;
}
/**
...
...
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