Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d2f60547
Commit
d2f60547
authored
Mar 02, 2014
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegts: fix teletext pts of streams with standalone pcr pid
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
d83a5b52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
mpegts.c
libavformat/mpegts.c
+17
-5
No files found.
libavformat/mpegts.c
View file @
d2f60547
...
...
@@ -1071,16 +1071,28 @@ skip:
while
((
p
=
av_find_program_from_stream
(
pes
->
stream
,
p
,
pes
->
st
->
index
)))
{
if
(
p
->
pcr_pid
!=
-
1
&&
p
->
discard
!=
AVDISCARD_ALL
)
{
MpegTSFilter
*
f
=
pes
->
ts
->
pids
[
p
->
pcr_pid
];
if
(
f
&&
f
->
type
==
MPEGTS_PES
)
{
PESContext
*
pcrpes
=
f
->
u
.
pes_filter
.
opaque
;
if
(
f
->
last_pcr
!=
-
1
&&
pcrpes
&&
pcrpes
->
st
&&
pcrpes
->
st
->
discard
!=
AVDISCARD_ALL
)
{
if
(
f
)
{
AVStream
*
st
=
NULL
;
if
(
f
->
type
==
MPEGTS_PES
)
{
PESContext
*
pcrpes
=
f
->
u
.
pes_filter
.
opaque
;
if
(
pcrpes
)
st
=
pcrpes
->
st
;
}
else
if
(
f
->
type
==
MPEGTS_PCR
)
{
int
i
;
for
(
i
=
0
;
i
<
p
->
nb_stream_indexes
;
i
++
)
{
AVStream
*
pst
=
pes
->
stream
->
streams
[
p
->
stream_index
[
i
]];
if
(
pst
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
st
=
pst
;
}
}
if
(
f
->
last_pcr
!=
-
1
&&
st
&&
st
->
discard
!=
AVDISCARD_ALL
)
{
// teletext packets do not always have correct timestamps,
// the standard says they should be handled after 40.6 ms at most,
// and the pcr error to this packet should be no more than 100 ms.
// TODO: we should interpolate the PCR, not just use the last one
int64_t
pcr
=
f
->
last_pcr
/
300
;
pes
->
st
->
pts_wrap_reference
=
pcrpes
->
st
->
pts_wrap_reference
;
pes
->
st
->
pts_wrap_behavior
=
pcrpes
->
st
->
pts_wrap_behavior
;
pes
->
st
->
pts_wrap_reference
=
st
->
pts_wrap_reference
;
pes
->
st
->
pts_wrap_behavior
=
st
->
pts_wrap_behavior
;
if
(
pes
->
dts
==
AV_NOPTS_VALUE
||
pes
->
dts
<
pcr
)
{
pes
->
pts
=
pes
->
dts
=
pcr
;
}
else
if
(
pes
->
dts
>
pcr
+
3654
+
9000
)
{
...
...
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