Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
ac9acd63
Commit
ac9acd63
authored
Aug 04, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ts: fixed a segfault when removing PCR stream.
parent
77c1e95d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+15
-9
No files found.
modules/mux/mpeg/ts.c
View file @
ac9acd63
...
...
@@ -2,7 +2,7 @@
* ts.c: MPEG-II TS Muxer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ts.c,v 1.2
3 2003/08/01 19:38:25
fenrir Exp $
* $Id: ts.c,v 1.2
4 2003/08/04 22:49:02
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
...
...
@@ -330,7 +330,8 @@ static int Open( vlc_object_t *p_this )
}
}
msg_Dbg
(
p_mux
,
"pcr_delay=%lld pcr_soft_delay=%lld"
,
p_sys
->
i_pcr_delay
,
p_sys
->
i_pcr_soft_delay
);
msg_Dbg
(
p_mux
,
"pcr_delay=%lld pcr_soft_delay=%lld"
,
p_sys
->
i_pcr_delay
,
p_sys
->
i_pcr_soft_delay
);
/* for TS gnration */
p_sys
->
i_pcr
=
0
;
p_sys
->
i_dts
=
0
;
...
...
@@ -512,7 +513,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_sys
->
i_pcr_pid
=
p_stream
->
i_pid
;
p_sys
->
p_pcr_input
=
p_input
;
/* Empty TS buffer (avoid broken data
or problem
with pcr stream changement ) */
/* Empty TS buffer (avoid broken data
/problems
with pcr stream changement ) */
while
(
(
p_data
=
BufferChainGet
(
&
p_sys
->
chain_ts
)
)
)
{
sout_BufferDelete
(
p_mux
->
p_sout
,
p_data
);
...
...
@@ -540,6 +541,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
/* Find a new pcr stream (Prefer Video Stream) */
p_sys
->
i_pcr_pid
=
0x1fff
;
p_sys
->
p_pcr_input
=
NULL
;
for
(
i
=
0
;
i
<
p_mux
->
i_nb_inputs
;
i
++
)
{
if
(
p_mux
->
pp_inputs
[
i
]
==
p_input
)
...
...
@@ -549,13 +551,16 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
if
(
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_cat
==
VIDEO_ES
)
{
p_sys
->
i_pcr_pid
=
((
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i
]
->
p_sys
)
->
i_pid
;
p_sys
->
i_pcr_pid
=
((
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i
]
->
p_sys
)
->
i_pid
;
p_sys
->
p_pcr_input
=
p_mux
->
pp_inputs
[
i
];
break
;
}
else
if
(
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_cat
!=
SPU_ES
&&
p_sys
->
i_pcr_pid
==
0x1fff
)
else
if
(
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_cat
!=
SPU_ES
&&
p_sys
->
i_pcr_pid
==
0x1fff
)
{
p_sys
->
i_pcr_pid
=
((
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i
]
->
p_sys
)
->
i_pid
;
p_sys
->
i_pcr_pid
=
((
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i
]
->
p_sys
)
->
i_pid
;
p_sys
->
p_pcr_input
=
p_mux
->
pp_inputs
[
i
];
}
}
...
...
@@ -587,7 +592,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
/* We only change PMT version (PAT isn't changed) */
p_sys
->
i_pmt_version_number
++
;
p_sys
->
i_pmt_version_number
%=
32
;
/*
Empty TS buffer (avoid broken data or problem with pcr stream changement
) */
/*
Empty TS buffer (avoid broken data/problems with pcr stream changement
) */
while
(
(
p_data
=
BufferChainGet
(
&
p_sys
->
chain_ts
)
)
)
{
sout_BufferDelete
(
p_mux
->
p_sout
,
p_data
);
...
...
@@ -724,7 +729,8 @@ static int TSFill( sout_mux_t *p_mux, sout_input_t *p_input )
{
if
(
p_input
->
p_fifo
->
i_depth
<=
0
)
{
if
(
p_input
->
p_fmt
->
i_cat
==
AUDIO_ES
||
p_input
->
p_fmt
->
i_cat
==
VIDEO_ES
)
if
(
p_input
->
p_fmt
->
i_cat
==
AUDIO_ES
||
p_input
->
p_fmt
->
i_cat
==
VIDEO_ES
)
{
/* We need more data */
return
VLC_EGENERIC
;
...
...
@@ -796,7 +802,7 @@ static int TSFill( sout_mux_t *p_mux, sout_input_t *p_input )
if
(
b_pcr_soft
&&
p_stream
->
chain_ts
.
p_first
)
{
p_stream
->
chain_ts
.
p_first
->
i_flags
=
SOUT_BUFFER_FLAGS_PRIVATE_PCR_SOFT
;
p_stream
->
chain_ts
.
p_first
->
i_flags
=
SOUT_BUFFER_FLAGS_PRIVATE_PCR_SOFT
;
}
return
VLC_SUCCESS
;
...
...
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