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
b18c9f1e
Commit
b18c9f1e
authored
May 04, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggtheora: Port changes from oggvorbis timestamp handling.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
fe5c5bcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
+12
-17
oggparsetheora.c
libavformat/oggparsetheora.c
+12
-17
No files found.
libavformat/oggparsetheora.c
View file @
b18c9f1e
...
...
@@ -162,26 +162,21 @@ static int theora_packet(AVFormatContext *s, int idx)
the total duration to the page granule to find the encoder delay and
set the first timestamp */
if
(
!
os
->
lastpts
)
{
if
(
(
!
os
->
lastpts
||
os
->
lastpts
==
AV_NOPTS_VALUE
)
&&
!
(
os
->
flags
&
OGG_FLAG_EOS
)
)
{
int
seg
;
uint8_t
*
last_pkt
=
os
->
buf
+
os
->
pstart
;
uint8_t
*
next_pkt
=
last_pkt
;
int
first_duration
=
0
;
duration
=
0
;
for
(
seg
=
0
;
seg
<
os
->
nsegs
;
seg
++
)
{
if
(
os
->
segments
[
seg
]
<
255
)
{
if
(
!
duration
)
first_duration
=
1
;
duration
++
;
last_pkt
=
next_pkt
+
os
->
segments
[
seg
];
}
next_pkt
+=
os
->
segments
[
seg
];
duration
=
1
;
for
(
seg
=
os
->
segp
;
seg
<
os
->
nsegs
;
seg
++
)
{
if
(
os
->
segments
[
seg
]
<
255
)
duration
++
;
}
os
->
lastpts
=
os
->
lastdts
=
theora_gptopts
(
s
,
idx
,
os
->
granule
,
NULL
)
-
duration
;
s
->
streams
[
idx
]
->
start_time
=
os
->
lastpts
+
first_duration
;
if
(
s
->
streams
[
idx
]
->
duration
)
s
->
streams
[
idx
]
->
duration
-=
s
->
streams
[
idx
]
->
start_time
;
if
(
s
->
streams
[
idx
]
->
start_time
==
AV_NOPTS_VALUE
)
{
s
->
streams
[
idx
]
->
start_time
=
os
->
lastpts
;
if
(
s
->
streams
[
idx
]
->
duration
)
s
->
streams
[
idx
]
->
duration
-=
s
->
streams
[
idx
]
->
start_time
;
}
}
/* parse packet duration */
...
...
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