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
4d26594b
Commit
4d26594b
authored
Dec 15, 2000
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhanced handling of stream discontinuities.
parent
a23f364a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
+36
-5
include/input_ext-intf.h
include/input_ext-intf.h
+1
-0
src/input/mpeg_system.c
src/input/mpeg_system.c
+35
-5
No files found.
include/input_ext-intf.h
View file @
4d26594b
...
@@ -29,6 +29,7 @@ typedef struct es_descriptor_s
...
@@ -29,6 +29,7 @@ typedef struct es_descriptor_s
struct
pes_packet_s
*
p_pes
;
/* Current PES */
struct
pes_packet_s
*
p_pes
;
/* Current PES */
struct
data_packet_s
*
p_last
;
/* The last packet gathered at present */
struct
data_packet_s
*
p_last
;
/* The last packet gathered at present */
int
i_pes_real_size
;
/* as indicated by the header */
int
i_pes_real_size
;
/* as indicated by the header */
boolean_t
b_discontinuity
;
/* Stream changed */
/* Decoder information */
/* Decoder information */
struct
decoder_fifo_s
*
p_decoder_fifo
;
struct
decoder_fifo_s
*
p_decoder_fifo
;
...
...
src/input/mpeg_system.c
View file @
4d26594b
...
@@ -390,7 +390,7 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
...
@@ -390,7 +390,7 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
*****************************************************************************
*****************************************************************************
* Gather a PES packet.
* Gather a PES packet.
*****************************************************************************/
*****************************************************************************/
void
input_GatherPES
(
input_thread_t
*
p_input
,
data_packet_t
*
p_data
,
void
input_GatherPES
(
input_thread_t
*
p_input
,
data_packet_t
*
p_data
,
es_descriptor_t
*
p_es
,
es_descriptor_t
*
p_es
,
boolean_t
b_unit_start
,
boolean_t
b_packet_lost
)
boolean_t
b_unit_start
,
boolean_t
b_packet_lost
)
{
{
...
@@ -401,10 +401,12 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t *p_data,
...
@@ -401,10 +401,12 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t *p_data,
/* If we lost data, insert an NULL data packet (philosophy : 0 is quite
/* If we lost data, insert an NULL data packet (philosophy : 0 is quite
* often an escape sequence in decoders, so that should make them wait
* often an escape sequence in decoders, so that should make them wait
* for the next start code). */
* for the next start code). */
if
(
b_packet_lost
&&
p_pes
!=
NULL
)
if
(
b_packet_lost
||
p_es
->
b_discontinuity
)
{
{
data_packet_t
*
p_pad_data
;
data_packet_t
*
p_pad_data
;
if
(
(
p_pad_data
=
p_input
->
p_plugin
->
pf_new_packet
(
p_input
,
if
(
(
p_pad_data
=
p_input
->
p_plugin
->
pf_new_packet
(
p_input
->
p_method_data
,
PADDING_PACKET_SIZE
))
==
NULL
)
PADDING_PACKET_SIZE
))
==
NULL
)
{
{
intf_ErrMsg
(
"Out of memory
\n
"
);
intf_ErrMsg
(
"Out of memory
\n
"
);
...
@@ -413,8 +415,28 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t *p_data,
...
@@ -413,8 +415,28 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t *p_data,
}
}
memset
(
p_data
->
p_buffer
,
0
,
PADDING_PACKET_SIZE
);
memset
(
p_data
->
p_buffer
,
0
,
PADDING_PACKET_SIZE
);
p_pad_data
->
b_discard_payload
=
1
;
p_pad_data
->
b_discard_payload
=
1
;
p_pes
->
b_messed_up
=
1
;
input_GatherPES
(
p_input
,
p_pad_data
,
p_es
,
0
,
0
);
if
(
p_pes
!=
NULL
)
{
p_pes
->
b_messed_up
=
p_pes
->
b_discontinuity
=
1
;
input_GatherPES
(
p_input
,
p_pad_data
,
p_es
,
0
,
0
);
}
else
{
if
(
(
p_pes
=
p_input
->
p_plugin
->
pf_new_pes
(
p_input
->
p_method_data
))
==
NULL
)
{
intf_ErrMsg
(
"Out of memory
\n
"
);
p_input
->
b_error
=
1
;
return
;
}
p_pes
->
p_first
=
p_pad_data
;
p_pes
->
b_messed_up
=
p_pes
->
b_discontinuity
=
1
;
input_DecodePES
(
p_input
,
p_es
);
}
p_es
->
b_discontinuity
=
0
;
}
}
if
(
b_unit_start
&&
p_pes
!=
NULL
)
if
(
b_unit_start
&&
p_pes
!=
NULL
)
...
@@ -571,11 +593,19 @@ static void CRDecode( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm,
...
@@ -571,11 +593,19 @@ static void CRDecode( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm,
(
(
p_pgrm
->
last_cr
-
cr_time
)
>
CR_MAX_GAP
(
(
p_pgrm
->
last_cr
-
cr_time
)
>
CR_MAX_GAP
||
(
p_pgrm
->
last_cr
-
cr_time
)
<
-
CR_MAX_GAP
)
)
)
||
(
p_pgrm
->
last_cr
-
cr_time
)
<
-
CR_MAX_GAP
)
)
)
{
{
int
i_es
;
/* Stream discontinuity. */
/* Stream discontinuity. */
intf_WarnMsg
(
3
,
"CR re-initialiazed"
);
intf_WarnMsg
(
3
,
"CR re-initialiazed"
);
CRReInit
(
p_pgrm
);
CRReInit
(
p_pgrm
);
p_pgrm
->
i_synchro_state
=
SYNCHRO_REINIT
;
p_pgrm
->
i_synchro_state
=
SYNCHRO_REINIT
;
p_pgrm
->
b_discontinuity
=
0
;
p_pgrm
->
b_discontinuity
=
0
;
/* Warn all the elementary streams */
for
(
i_es
=
0
;
i_es
<
p_pgrm
->
i_es_number
;
i_es
++
)
{
p_pgrm
->
pp_es
[
i_es
]
->
b_discontinuity
=
1
;
}
}
}
p_pgrm
->
last_cr
=
cr_time
;
p_pgrm
->
last_cr
=
cr_time
;
...
...
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