Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
f3ba7c54
Commit
f3ba7c54
authored
Jan 15, 2009
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use delay for subs and dirac too
Originally committed as revision 16614 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
a57fb91c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
mpegtsenc.c
libavformat/mpegtsenc.c
+10
-4
No files found.
libavformat/mpegtsenc.c
View file @
f3ba7c54
...
@@ -696,16 +696,22 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -696,16 +696,22 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
int
len
,
max_payload_size
;
int
len
,
max_payload_size
;
const
uint8_t
*
access_unit_index
=
NULL
;
const
uint8_t
*
access_unit_index
=
NULL
;
const
uint64_t
delay
=
av_rescale
(
s
->
max_delay
,
90000
,
AV_TIME_BASE
);
const
uint64_t
delay
=
av_rescale
(
s
->
max_delay
,
90000
,
AV_TIME_BASE
);
int64_t
dts
=
AV_NOPTS_VALUE
,
pts
=
AV_NOPTS_VALUE
;
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
)
pts
=
pkt
->
pts
+
delay
;
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
)
dts
=
pkt
->
dts
+
delay
;
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_SUBTITLE
)
{
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_SUBTITLE
)
{
/* for subtitle, a single PES packet must be generated */
/* for subtitle, a single PES packet must be generated */
mpegts_write_pes
(
s
,
st
,
buf
,
size
,
p
kt
->
p
ts
,
AV_NOPTS_VALUE
);
mpegts_write_pes
(
s
,
st
,
buf
,
size
,
pts
,
AV_NOPTS_VALUE
);
return
0
;
return
0
;
}
}
if
(
st
->
codec
->
codec_id
==
CODEC_ID_DIRAC
)
{
if
(
st
->
codec
->
codec_id
==
CODEC_ID_DIRAC
)
{
/* for Dirac, a single PES packet must be generated */
/* for Dirac, a single PES packet must be generated */
mpegts_write_pes
(
s
,
st
,
buf
,
size
,
p
kt
->
pts
,
pkt
->
dts
);
mpegts_write_pes
(
s
,
st
,
buf
,
size
,
p
ts
,
dts
);
return
0
;
return
0
;
}
}
max_payload_size
=
DEFAULT_PES_PAYLOAD_SIZE
;
max_payload_size
=
DEFAULT_PES_PAYLOAD_SIZE
;
...
@@ -758,8 +764,8 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -758,8 +764,8 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
if
(
access_unit_index
&&
access_unit_index
<
buf
&&
if
(
access_unit_index
&&
access_unit_index
<
buf
&&
ts_st
->
payload_pts
==
AV_NOPTS_VALUE
&&
ts_st
->
payload_pts
==
AV_NOPTS_VALUE
&&
ts_st
->
payload_dts
==
AV_NOPTS_VALUE
)
{
ts_st
->
payload_dts
==
AV_NOPTS_VALUE
)
{
ts_st
->
payload_dts
=
pkt
->
dts
+
delay
;
ts_st
->
payload_dts
=
dts
;
ts_st
->
payload_pts
=
p
kt
->
pts
+
delay
;
ts_st
->
payload_pts
=
p
ts
;
}
}
if
(
ts_st
->
payload_index
>=
max_payload_size
)
{
if
(
ts_st
->
payload_index
>=
max_payload_size
)
{
mpegts_write_pes
(
s
,
st
,
ts_st
->
payload
,
ts_st
->
payload_index
,
mpegts_write_pes
(
s
,
st
,
ts_st
->
payload
,
ts_st
->
payload_index
,
...
...
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