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
f9b9dd87
Commit
f9b9dd87
authored
Jan 05, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: cosmetics, reformat av_read_frame().
parent
6450599e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
utils.c
libavformat/utils.c
+11
-12
No files found.
libavformat/utils.c
View file @
f9b9dd87
...
...
@@ -1261,30 +1261,29 @@ static int read_from_packet_buffer(AVFormatContext *s, AVPacket *pkt)
int
av_read_frame
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
AVPacketList
*
pktl
;
int
eof
=
0
;
const
int
genpts
=
s
->
flags
&
AVFMT_FLAG_GENPTS
;
const
int
genpts
=
s
->
flags
&
AVFMT_FLAG_GENPTS
;
int
eof
=
0
;
if
(
!
genpts
)
return
s
->
packet_buffer
?
read_from_packet_buffer
(
s
,
pkt
)
:
read_frame_internal
(
s
,
pkt
);
for
(;;)
{
for
(;;)
{
int
ret
;
pktl
=
s
->
packet_buffer
;
AVPacketList
*
pktl
=
s
->
packet_buffer
;
if
(
pktl
)
{
AVPacket
*
next_pkt
=
&
pktl
->
pkt
;
AVPacket
*
next_pkt
=
&
pktl
->
pkt
;
if
(
next_pkt
->
dts
!=
AV_NOPTS_VALUE
)
{
int
wrap_bits
=
s
->
streams
[
next_pkt
->
stream_index
]
->
pts_wrap_bits
;
while
(
pktl
&&
next_pkt
->
pts
==
AV_NOPTS_VALUE
)
{
if
(
pktl
->
pkt
.
stream_index
==
next_pkt
->
stream_index
&&
(
0
>
av_compare_mod
(
next_pkt
->
dts
,
pktl
->
pkt
.
dts
,
2LL
<<
(
wrap_bits
-
1
)))
&&
av_compare_mod
(
pktl
->
pkt
.
pts
,
pktl
->
pkt
.
dts
,
2LL
<<
(
wrap_bits
-
1
)))
{
//not b frame
next_pkt
->
pts
=
pktl
->
pkt
.
dts
;
while
(
pktl
&&
next_pkt
->
pts
==
AV_NOPTS_VALUE
)
{
if
(
pktl
->
pkt
.
stream_index
==
next_pkt
->
stream_index
&&
(
av_compare_mod
(
next_pkt
->
dts
,
pktl
->
pkt
.
dts
,
2LL
<<
(
wrap_bits
-
1
))
<
0
)
&&
av_compare_mod
(
pktl
->
pkt
.
pts
,
pktl
->
pkt
.
dts
,
2LL
<<
(
wrap_bits
-
1
)))
{
//not b frame
next_pkt
->
pts
=
pktl
->
pkt
.
dts
;
}
pktl
=
pktl
->
next
;
pktl
=
pktl
->
next
;
}
pktl
=
s
->
packet_buffer
;
}
...
...
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