Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c4e756b0
Commit
c4e756b0
authored
Aug 05, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent wrong es selection on invalid syntax (part of #1821)
Warn on invalid syntax. Check malloc return values.
parent
15151cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
modules/stream_out/duplicate.c
modules/stream_out/duplicate.c
+26
-8
No files found.
modules/stream_out/duplicate.c
View file @
c4e756b0
...
...
@@ -88,11 +88,11 @@ static int Open( vlc_object_t *p_this )
msg_Dbg
(
p_stream
,
"creating 'duplicate'"
);
p_sys
=
malloc
(
sizeof
(
sout_stream_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
p_sys
->
i_nb_streams
=
0
;
p_sys
->
pp_streams
=
NULL
;
p_sys
->
i_nb_select
=
0
;
p_sys
->
ppsz_select
=
NULL
;
TAB_INIT
(
p_sys
->
i_nb_streams
,
p_sys
->
pp_streams
);
TAB_INIT
(
p_sys
->
i_nb_select
,
p_sys
->
ppsz_select
);
for
(
p_cfg
=
p_stream
->
p_cfg
;
p_cfg
!=
NULL
;
p_cfg
=
p_cfg
->
p_next
)
{
...
...
@@ -114,10 +114,24 @@ static int Open( vlc_object_t *p_this )
char
*
psz
=
p_cfg
->
psz_value
;
if
(
p_sys
->
i_nb_select
>
0
&&
psz
&&
*
psz
)
{
msg_Dbg
(
p_stream
,
" * apply selection %s"
,
psz
);
p_sys
->
ppsz_select
[
p_sys
->
i_nb_select
-
1
]
=
strdup
(
psz
);
char
**
ppsz_select
=
&
p_sys
->
ppsz_select
[
p_sys
->
i_nb_select
-
1
];
if
(
*
ppsz_select
)
{
msg_Err
(
p_stream
,
" * ignore selection `%s' (it already has `%s')"
,
psz
,
*
ppsz_select
);
}
else
{
msg_Dbg
(
p_stream
,
" * apply selection `%s'"
,
psz
);
*
ppsz_select
=
strdup
(
psz
);
}
}
}
else
{
msg_Err
(
p_stream
,
" * ignore unknown option `%s'"
,
p_cfg
->
psz_name
);
}
}
if
(
p_sys
->
i_nb_streams
==
0
)
...
...
@@ -169,6 +183,9 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
int
i_stream
,
i_valid_streams
=
0
;
id
=
malloc
(
sizeof
(
sout_stream_id_t
)
);
if
(
!
id
)
return
NULL
;
id
->
i_nb_ids
=
0
;
id
->
pp_ids
=
NULL
;
...
...
@@ -261,8 +278,9 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
{
p_dup
=
block_Duplicate
(
p_buffer
);
p_dup_stream
->
pf_send
(
p_dup_stream
,
id
->
pp_ids
[
i_stream
],
p_dup
);
if
(
p_dup
)
p_dup_stream
->
pf_send
(
p_dup_stream
,
id
->
pp_ids
[
i_stream
],
p_dup
);
}
}
...
...
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