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
682e1602
Commit
682e1602
authored
Aug 25, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: revector, use strtok_r()
parent
70a513b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
21 deletions
+18
-21
src/input/input.c
src/input/input.c
+6
-4
src/input/stream_filter.c
src/input/stream_filter.c
+12
-17
No files found.
src/input/input.c
View file @
682e1602
...
...
@@ -2311,10 +2311,12 @@ static int InputSourceInit( input_thread_t *p_input,
/* Add stream filters */
p_stream
=
stream_FilterAutoNew
(
p_stream
);
char
*
psz_stream_filter
=
var_GetNonEmptyString
(
p_input
,
"stream-filter"
);
p_stream
=
stream_FilterChainNew
(
p_stream
,
psz_stream_filter
);
free
(
psz_stream_filter
);
char
*
filters
=
var_GetNonEmptyString
(
p_input
,
"stream-filter"
);
if
(
filters
!=
NULL
)
{
p_stream
=
stream_FilterChainNew
(
p_stream
,
filters
);
free
(
filters
);
}
if
(
var_GetBool
(
p_input
,
"input-record-native"
)
)
p_stream
=
stream_FilterChainNew
(
p_stream
,
"record"
);
...
...
src/input/stream_filter.c
View file @
682e1602
...
...
@@ -88,31 +88,26 @@ stream_t *stream_FilterAutoNew( stream_t *p_source )
return
p_source
;
}
/* Add specified stream filter(s) */
stream_t
*
stream_FilterChainNew
(
stream_t
*
p_source
,
const
char
*
psz_chain
)
{
if
(
psz_chain
==
NULL
)
/* Add user stream filter */
char
*
chain
=
strdup
(
psz_chain
);
if
(
unlikely
(
chain
==
NULL
)
)
return
p_source
;
/* Add user stream filter */
char
*
psz_tmp
=
strdup
(
psz_chain
);
char
*
psz
=
psz_tmp
;
while
(
psz
&&
*
psz
)
char
*
buf
;
for
(
const
char
*
name
=
strtok_r
(
chain
,
":"
,
&
buf
);
name
!=
NULL
;
name
=
strtok_r
(
NULL
,
":"
,
&
buf
)
)
{
stream_t
*
p_filter
;
char
*
psz_end
=
strchr
(
psz
,
':'
);
if
(
psz_end
)
*
psz_end
++
=
'\0'
;
p_filter
=
stream_FilterNew
(
p_source
,
psz
);
if
(
p_filter
)
stream_t
*
p_filter
=
stream_FilterNew
(
p_source
,
name
);
if
(
p_filter
!=
NULL
)
p_source
=
p_filter
;
else
msg_Warn
(
p_source
,
"failed to insert stream filter %s"
,
psz
);
psz
=
psz_end
;
msg_Warn
(
p_source
,
"cannot insert stream filter %s"
,
name
);
}
free
(
psz_tmp
);
free
(
chain
);
return
p_source
;
}
...
...
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