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
33eb0cd1
Commit
33eb0cd1
authored
Jul 26, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream: merge stream_CommonDelete() and stream_Delete()
parent
96244c3d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
27 deletions
+21
-27
src/input/stream.c
src/input/stream.c
+14
-12
src/input/stream.h
src/input/stream.h
+0
-1
src/input/stream_access.c
src/input/stream_access.c
+1
-2
src/input/stream_demux.c
src/input/stream_demux.c
+3
-5
src/input/stream_filter.c
src/input/stream_filter.c
+2
-4
src/input/stream_memory.c
src/input/stream_memory.c
+1
-3
No files found.
src/input/stream.c
View file @
33eb0cd1
...
...
@@ -64,7 +64,15 @@ stream_t *stream_CommonNew(vlc_object_t *parent)
stream_t
*
s
=
&
priv
->
stream
;
s
->
b_error
=
false
;
s
->
p_module
=
NULL
;
s
->
psz_url
=
NULL
;
s
->
p_source
=
NULL
;
s
->
pf_read
=
NULL
;
s
->
pf_readdir
=
NULL
;
s
->
pf_control
=
NULL
;
s
->
pf_destroy
=
NULL
;
s
->
p_input
=
NULL
;
priv
->
peek
=
NULL
;
/* UTF16 and UTF32 text file conversion */
...
...
@@ -76,20 +84,22 @@ stream_t *stream_CommonNew(vlc_object_t *parent)
}
/**
* Destroy
s a VLC stream object
* Destroy
a stream
*/
void
stream_
CommonDelete
(
stream_t
*
s
)
void
stream_
Delete
(
stream_t
*
s
)
{
stream_priv_t
*
priv
=
(
stream_priv_t
*
)
s
;
if
(
priv
->
text
.
conv
!=
(
vlc_iconv_t
)(
-
1
))
vlc_iconv_close
(
priv
->
text
.
conv
);
if
(
priv
->
peek
!=
NULL
)
block_Release
(
priv
->
peek
);
if
(
s
->
pf_destroy
!=
NULL
)
s
->
pf_destroy
(
s
);
free
(
s
->
psz_url
);
vlc_object_release
(
s
);
vlc_object_release
(
s
);
}
#undef stream_UrlNew
...
...
@@ -513,14 +523,6 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
return
s
->
pf_control
(
s
,
cmd
,
args
);
}
/**
* Destroy a stream
*/
void
stream_Delete
(
stream_t
*
s
)
{
s
->
pf_destroy
(
s
);
}
int
stream_Control
(
stream_t
*
s
,
int
i_query
,
...
)
{
va_list
args
;
...
...
src/input/stream.h
View file @
33eb0cd1
...
...
@@ -30,7 +30,6 @@
/* */
stream_t
*
stream_CommonNew
(
vlc_object_t
*
);
void
stream_CommonDelete
(
stream_t
*
);
/**
* This function creates a stream_t with an access_t back-end.
...
...
src/input/stream_access.c
View file @
33eb0cd1
...
...
@@ -230,7 +230,6 @@ static void AStreamDestroy(stream_t *s)
{
stream_sys_t
*
sys
=
s
->
p_sys
;
stream_CommonDelete
(
s
);
if
(
sys
->
block
!=
NULL
)
block_Release
(
sys
->
block
);
vlc_access_Delete
(
sys
->
access
);
...
...
@@ -269,6 +268,6 @@ stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
return
s
;
error:
free
(
sys
);
stream_
Common
Delete
(
s
);
stream_Delete
(
s
);
return
NULL
;
}
src/input/stream_demux.c
View file @
33eb0cd1
...
...
@@ -81,8 +81,7 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
s
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
!
s
->
p_sys
)
{
free
(
p_sys
);
stream_CommonDelete
(
s
);
stream_Delete
(
s
);
return
NULL
;
}
...
...
@@ -97,7 +96,7 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
/* decoder fifo */
if
(
(
p_sys
->
p_fifo
=
block_FifoNew
()
)
==
NULL
)
{
stream_
Common
Delete
(
s
);
stream_Delete
(
s
);
free
(
p_sys
->
psz_name
);
free
(
p_sys
);
return
NULL
;
...
...
@@ -110,7 +109,7 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
{
vlc_mutex_destroy
(
&
p_sys
->
lock
);
block_FifoRelease
(
p_sys
->
p_fifo
);
stream_
Common
Delete
(
s
);
stream_Delete
(
s
);
free
(
p_sys
->
psz_name
);
free
(
p_sys
);
return
NULL
;
...
...
@@ -169,7 +168,6 @@ static void DStreamDelete( stream_t *s )
block_FifoRelease
(
p_sys
->
p_fifo
);
free
(
p_sys
->
psz_name
);
free
(
p_sys
);
stream_CommonDelete
(
s
);
}
...
...
src/input/stream_filter.c
View file @
33eb0cd1
...
...
@@ -53,7 +53,7 @@ stream_t *stream_FilterNew( stream_t *p_source,
s
->
psz_url
=
strdup
(
p_source
->
psz_url
);
if
(
unlikely
(
s
->
psz_url
==
NULL
)
)
{
stream_
Common
Delete
(
s
);
stream_Delete
(
s
);
return
NULL
;
}
}
...
...
@@ -64,7 +64,7 @@ stream_t *stream_FilterNew( stream_t *p_source,
if
(
!
s
->
p_module
)
{
stream_
Common
Delete
(
s
);
stream_Delete
(
s
);
return
NULL
;
}
...
...
@@ -118,8 +118,6 @@ static void StreamDelete( stream_t *s )
if
(
s
->
p_source
)
stream_Delete
(
s
->
p_source
);
stream_CommonDelete
(
s
);
}
input_item_t
*
stream_FilterDefaultReadDir
(
stream_t
*
s
)
...
...
src/input/stream_memory.c
View file @
33eb0cd1
...
...
@@ -62,8 +62,7 @@ stream_t *stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
s
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
stream_sys_t
)
);
if
(
!
s
->
p_sys
)
{
stream_CommonDelete
(
s
);
free
(
p_sys
);
stream_Delete
(
s
);
return
NULL
;
}
p_sys
->
i_pos
=
0
;
...
...
@@ -83,7 +82,6 @@ static void Delete( stream_t *s )
{
if
(
!
s
->
p_sys
->
i_preserve_memory
)
free
(
s
->
p_sys
->
p_buffer
);
free
(
s
->
p_sys
);
stream_CommonDelete
(
s
);
}
/****************************************************************************
...
...
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