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
c9e95ac9
Commit
c9e95ac9
authored
Sep 10, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS mux: fix
ebcc69cf
Only modify bitstream (PCR & PES), but not VLC core timestamps
parent
f06d95b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
modules/mux/mpeg/pes.c
modules/mux/mpeg/pes.c
+8
-5
modules/mux/mpeg/pes.h
modules/mux/mpeg/pes.h
+1
-1
modules/mux/mpeg/ps.c
modules/mux/mpeg/ps.c
+1
-1
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+4
-7
No files found.
modules/mux/mpeg/pes.c
View file @
c9e95ac9
...
...
@@ -319,11 +319,10 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
void
EStoPES
(
block_t
**
pp_pes
,
es_format_t
*
p_fmt
,
int
i_stream_id
,
int
b_mpeg2
,
int
b_data_alignment
,
int
i_header_size
,
int
i_max_pes_size
)
int
i_max_pes_size
,
mtime_t
ts_offset
)
{
block_t
*
p_es
=
*
pp_pes
;
block_t
*
p_pes
=
NULL
;
mtime_t
i_pts
,
i_dts
,
i_length
;
uint8_t
*
p_data
;
int
i_size
;
...
...
@@ -383,8 +382,12 @@ void EStoPES ( block_t **pp_pes,
}
i_pts
=
p_es
->
i_pts
<=
0
?
0
:
p_es
->
i_pts
*
9
/
100
;
// 90000 units clock
i_dts
=
p_es
->
i_dts
<=
0
?
0
:
p_es
->
i_dts
*
9
/
100
;
// 90000 units clock
mtime_t
i_dts
=
0
;
mtime_t
i_pts
=
0
;
if
(
p_es
->
i_pts
>
VLC_TS_INVALID
)
i_pts
=
(
p_es
->
i_pts
-
ts_offset
)
*
9
/
100
;
if
(
p_es
->
i_dts
>
VLC_TS_INVALID
)
i_dts
=
(
p_es
->
i_dts
-
ts_offset
)
*
9
/
100
;
i_size
=
p_es
->
i_buffer
;
p_data
=
p_es
->
p_buffer
;
...
...
@@ -434,7 +437,7 @@ void EStoPES ( block_t **pp_pes,
/* Now redate all pes */
i_dts
=
p_pes
->
i_dts
;
i_length
=
p_pes
->
i_length
/
i_pes_count
;
mtime_t
i_length
=
p_pes
->
i_length
/
i_pes_count
;
while
(
p_pes
)
{
p_pes
->
i_dts
=
i_dts
;
...
...
modules/mux/mpeg/pes.h
View file @
c9e95ac9
...
...
@@ -38,4 +38,4 @@
void
EStoPES
(
block_t
**
pp_pes
,
es_format_t
*
p_fmt
,
int
i_stream_id
,
int
b_mpeg2
,
int
b_data_alignment
,
int
i_header_size
,
int
i_max_pes_size
);
int
i_max_pes_size
,
mtime_t
ts_offset
);
modules/mux/mpeg/ps.c
View file @
c9e95ac9
...
...
@@ -514,7 +514,7 @@ static int Mux( sout_mux_t *p_mux )
/* Get and mux a packet */
p_data
=
block_FifoGet
(
p_input
->
p_fifo
);
EStoPES
(
&
p_data
,
p_input
->
p_fmt
,
p_stream
->
i_stream_id
,
p_sys
->
b_mpeg2
,
0
,
0
,
p_sys
->
i_pes_max_size
);
p_sys
->
b_mpeg2
,
0
,
0
,
p_sys
->
i_pes_max_size
,
0
);
block_ChainAppend
(
&
p_ps
,
p_data
);
...
...
modules/mux/mpeg/ts.c
View file @
c9e95ac9
...
...
@@ -1274,7 +1274,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
/* Don't mux the SPU yet if it is too early */
block_t
*
p_spu
=
block_FifoShow
(
p_input
->
p_fifo
);
int64_t
i_spu_delay
=
p_spu
->
i_dts
-
p_
sys
->
first_dts
-
p_
pcr_stream
->
i_pes_dts
;
int64_t
i_spu_delay
=
p_spu
->
i_dts
-
p_pcr_stream
->
i_pes_dts
;
if
(
(
i_spu_delay
>
i_shaping_delay
)
&&
(
i_spu_delay
<
100
*
CLOCK_FREQ
)
)
continue
;
...
...
@@ -1320,9 +1320,6 @@ static bool MuxStreams(sout_mux_t *p_mux )
if
(
p_sys
->
first_dts
==
0
)
p_sys
->
first_dts
=
p_data
->
i_dts
;
p_data
->
i_dts
-=
p_sys
->
first_dts
;
p_data
->
i_pts
-=
p_sys
->
first_dts
;
if
(
(
p_pcr_stream
->
i_pes_dts
>
0
&&
p_data
->
i_dts
-
10
*
CLOCK_FREQ
>
p_pcr_stream
->
i_pes_dts
+
p_pcr_stream
->
i_pes_length
)
||
...
...
@@ -1384,7 +1381,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
p_spu
->
p_buffer
[
2
]
=
' '
;
EStoPES
(
&
p_spu
,
p_input
->
p_fmt
,
p_stream
->
i_stream_id
,
1
,
0
,
0
,
0
);
p_stream
->
i_stream_id
,
1
,
0
,
0
,
0
,
p_sys
->
first_dts
);
p_data
->
p_next
=
p_spu
;
}
break
;
...
...
@@ -1431,7 +1428,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
EStoPES
(
&
p_data
,
p_input
->
p_fmt
,
p_stream
->
i_stream_id
,
1
,
b_data_alignment
,
i_header_size
,
i_max_pes_size
);
i_max_pes_size
,
p_sys
->
first_dts
);
BufferChainAppend
(
&
p_stream
->
chain_pes
,
p_data
);
...
...
@@ -1799,7 +1796,7 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
if
(
p_ts
->
i_flags
&
BLOCK_FLAG_CLOCK
)
{
/* msg_Dbg( p_mux, "pcr=%lld ms", p_ts->i_dts / 1000 ); */
TSSetPCR
(
p_ts
,
p_ts
->
i_dts
-
p_sys
->
i_dts_delay
);
TSSetPCR
(
p_ts
,
p_ts
->
i_dts
-
p_sys
->
i_dts_delay
-
p_sys
->
first_dts
);
}
if
(
p_ts
->
i_flags
&
BLOCK_FLAG_SCRAMBLED
)
{
...
...
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