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
176639fe
Commit
176639fe
authored
Aug 18, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ts: fix PCR value when using pcr-soft.
parent
e2f255de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+10
-6
No files found.
modules/mux/mpeg/ts.c
View file @
176639fe
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ts.c: MPEG-II TS Muxer
* ts.c: MPEG-II TS Muxer
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ts.c,v 1.2
8 2003/08/14 23:37:54
fenrir Exp $
* $Id: ts.c,v 1.2
9 2003/08/18 17:25:51
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -215,7 +215,7 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
...
@@ -215,7 +215,7 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
static
int
TSFill
(
sout_mux_t
*
,
sout_input_t
*
);
static
int
TSFill
(
sout_mux_t
*
,
sout_input_t
*
);
static
void
PEStoTS
(
sout_instance_t
*
,
sout_buffer_chain_t
*
,
sout_buffer_t
*
,
ts_stream_t
*
,
vlc_bool_t
);
static
void
PEStoTS
(
sout_instance_t
*
,
sout_buffer_chain_t
*
,
sout_buffer_t
*
,
ts_stream_t
*
,
vlc_bool_t
);
static
void
TSSetDate
(
sout_buffer_chain_t
*
,
mtime_t
,
mtime_t
);
static
void
TSSetDate
(
sout_buffer_chain_t
*
,
mtime_t
,
mtime_t
,
mtime_t
);
static
void
TSSetConstraints
(
sout_mux_t
*
,
sout_buffer_chain_t
*
,
static
void
TSSetConstraints
(
sout_mux_t
*
,
sout_buffer_chain_t
*
,
mtime_t
i_length
,
int
i_bitrate_min
,
int
i_bitrate_max
);
mtime_t
i_length
,
int
i_bitrate_min
,
int
i_bitrate_max
);
...
@@ -671,8 +671,10 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -671,8 +671,10 @@ static int Mux( sout_mux_t *p_mux )
/* Send all data */
/* Send all data */
TSSetDate
(
&
p_sys
->
chain_ts
,
TSSetDate
(
&
p_sys
->
chain_ts
,
p_sys
->
i_dts
+
3
*
p_sys
->
i_pcr_delay
/
2
,
/* latency is equal to i_pcr_delay, 3/2 is for security */
p_sys
->
i_dts
,
p_sys
->
i_length
);
p_sys
->
i_length
,
3
*
p_sys
->
i_pcr_delay
/
2
);
/* latency is equal to i_pcr_delay
3/2 is for security */
sout_AccessOutWrite
(
p_mux
->
p_access
,
p_ts
);
sout_AccessOutWrite
(
p_mux
->
p_access
,
p_ts
);
/* Reset the ts chain */
/* Reset the ts chain */
...
@@ -778,7 +780,7 @@ static int TSFill( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -778,7 +780,7 @@ static int TSFill( sout_mux_t *p_mux, sout_input_t *p_input )
BufferChainInit
(
&
p_stream
->
chain_ts
);
BufferChainInit
(
&
p_stream
->
chain_ts
);
PEStoTS
(
p_mux
->
p_sout
,
&
p_stream
->
chain_ts
,
p_data
,
p_stream
,
b_pcr
);
PEStoTS
(
p_mux
->
p_sout
,
&
p_stream
->
chain_ts
,
p_data
,
p_stream
,
b_pcr
);
TSSetDate
(
&
p_stream
->
chain_ts
,
i_dts
,
i_length
);
TSSetDate
(
&
p_stream
->
chain_ts
,
i_dts
,
i_length
,
0
);
if
(
b_pcr_soft
&&
p_stream
->
chain_ts
.
p_first
)
if
(
b_pcr_soft
&&
p_stream
->
chain_ts
.
p_first
)
{
{
...
@@ -872,7 +874,8 @@ static void TSSetConstraints( sout_mux_t *p_mux, sout_buffer_chain_t *c, mtime_t
...
@@ -872,7 +874,8 @@ static void TSSetConstraints( sout_mux_t *p_mux, sout_buffer_chain_t *c, mtime_t
}
}
}
}
static
void
TSSetDate
(
sout_buffer_chain_t
*
c
,
mtime_t
i_dts
,
mtime_t
i_length
)
static
void
TSSetDate
(
sout_buffer_chain_t
*
c
,
mtime_t
i_dts
,
mtime_t
i_length
,
mtime_t
i_send_offset
)
{
{
sout_buffer_t
*
p_ts
;
sout_buffer_t
*
p_ts
;
mtime_t
i_delta
=
i_length
/
c
->
i_depth
;
mtime_t
i_delta
=
i_length
/
c
->
i_depth
;
...
@@ -893,6 +896,7 @@ static void TSSetDate( sout_buffer_chain_t *c, mtime_t i_dts, mtime_t i_length )
...
@@ -893,6 +896,7 @@ static void TSSetDate( sout_buffer_chain_t *c, mtime_t i_dts, mtime_t i_length )
p_ts
->
p_buffer
[
9
]
=
(
i_pcr
>>
1
)
&
0xff
;
p_ts
->
p_buffer
[
9
]
=
(
i_pcr
>>
1
)
&
0xff
;
p_ts
->
p_buffer
[
10
]
=
(
i_pcr
<<
7
)
&
0x80
;
p_ts
->
p_buffer
[
10
]
=
(
i_pcr
<<
7
)
&
0x80
;
}
}
p_ts
->
i_dts
+=
i_send_offset
;
i_packet
++
;
i_packet
++
;
}
}
...
...
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