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
d2cab951
Commit
d2cab951
authored
Aug 24, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggdec: Make sure start time correction is applied once to each stream
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
bd464037
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
oggdec.c
libavformat/oggdec.c
+16
-4
oggdec.h
libavformat/oggdec.h
+1
-0
No files found.
libavformat/oggdec.c
View file @
d2cab951
...
...
@@ -452,6 +452,7 @@ static int ogg_get_length(AVFormatContext *s)
struct
ogg
*
ogg
=
s
->
priv_data
;
int
i
;
int64_t
size
,
end
;
int
streams_left
=
0
;
if
(
!
s
->
pb
->
seekable
)
return
0
;
...
...
@@ -473,8 +474,14 @@ static int ogg_get_length(AVFormatContext *s)
ogg
->
streams
[
i
].
codec
)
{
s
->
streams
[
i
]
->
duration
=
ogg_gptopts
(
s
,
i
,
ogg
->
streams
[
i
].
granule
,
NULL
);
if
(
s
->
streams
[
i
]
->
start_time
!=
AV_NOPTS_VALUE
)
if
(
s
->
streams
[
i
]
->
start_time
!=
AV_NOPTS_VALUE
)
{
s
->
streams
[
i
]
->
duration
-=
s
->
streams
[
i
]
->
start_time
;
streams_left
-=
(
ogg
->
streams
[
i
].
got_start
==-
1
);
ogg
->
streams
[
i
].
got_start
=
1
;
}
else
if
(
!
ogg
->
streams
[
i
].
got_start
){
ogg
->
streams
[
i
].
got_start
=
-
1
;
streams_left
++
;
}
}
}
...
...
@@ -485,9 +492,14 @@ static int ogg_get_length(AVFormatContext *s)
while
(
!
ogg_read_page
(
s
,
&
i
)){
if
(
ogg
->
streams
[
i
].
granule
!=
-
1
&&
ogg
->
streams
[
i
].
granule
!=
0
&&
ogg
->
streams
[
i
].
codec
)
{
s
->
streams
[
i
]
->
duration
-=
ogg_gptopts
(
s
,
i
,
ogg
->
streams
[
i
].
granule
,
NULL
);
break
;
if
(
s
->
streams
[
i
]
->
duration
&&
s
->
streams
[
i
]
->
start_time
==
AV_NOPTS_VALUE
&&
!
ogg
->
streams
[
i
].
got_start
){
s
->
streams
[
i
]
->
duration
-=
ogg_gptopts
(
s
,
i
,
ogg
->
streams
[
i
].
granule
,
NULL
);
ogg
->
streams
[
i
].
got_start
=
1
;
streams_left
--
;
}
if
(
streams_left
<=
0
)
break
;
}
}
ogg_restore
(
s
,
0
);
...
...
libavformat/oggdec.h
View file @
d2cab951
...
...
@@ -75,6 +75,7 @@ struct ogg_stream {
int
incomplete
;
///< whether we're expecting a continuation in the next page
int
page_end
;
///< current packet is the last one completed in the page
int
keyframe_seek
;
int
got_start
;
void
*
private
;
};
...
...
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