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
f39678b3
Commit
f39678b3
authored
Mar 10, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/bink: properly mark packets that are key frames
parent
6eae7e56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
bink.c
libavformat/bink.c
+8
-3
No files found.
libavformat/bink.c
View file @
f39678b3
...
@@ -56,6 +56,7 @@ typedef struct BinkDemuxContext {
...
@@ -56,6 +56,7 @@ typedef struct BinkDemuxContext {
int64_t
audio_pts
[
BINK_MAX_AUDIO_TRACKS
];
int64_t
audio_pts
[
BINK_MAX_AUDIO_TRACKS
];
uint32_t
remain_packet_size
;
uint32_t
remain_packet_size
;
int
flags
;
int
smush_size
;
int
smush_size
;
}
BinkDemuxContext
;
}
BinkDemuxContext
;
...
@@ -90,6 +91,7 @@ static int read_header(AVFormatContext *s)
...
@@ -90,6 +91,7 @@ static int read_header(AVFormatContext *s)
unsigned
int
i
;
unsigned
int
i
;
uint32_t
pos
,
next_pos
;
uint32_t
pos
,
next_pos
;
uint16_t
flags
;
uint16_t
flags
;
int
next_keyframe
=
1
;
int
keyframe
;
int
keyframe
;
int
ret
;
int
ret
;
uint32_t
signature
;
uint32_t
signature
;
...
@@ -203,12 +205,13 @@ static int read_header(AVFormatContext *s)
...
@@ -203,12 +205,13 @@ static int read_header(AVFormatContext *s)
next_pos
=
avio_rl32
(
pb
);
next_pos
=
avio_rl32
(
pb
);
for
(
i
=
0
;
i
<
vst
->
duration
;
i
++
)
{
for
(
i
=
0
;
i
<
vst
->
duration
;
i
++
)
{
pos
=
next_pos
;
pos
=
next_pos
;
keyframe
=
next_keyframe
;
if
(
i
==
vst
->
duration
-
1
)
{
if
(
i
==
vst
->
duration
-
1
)
{
next_pos
=
bink
->
file_size
;
next_pos
=
bink
->
file_size
;
keyframe
=
0
;
next_
keyframe
=
0
;
}
else
{
}
else
{
next_pos
=
avio_rl32
(
pb
);
next_pos
=
avio_rl32
(
pb
);
keyframe
=
pos
&
1
;
next_keyframe
=
next_
pos
&
1
;
}
}
pos
&=
~
1
;
pos
&=
~
1
;
next_pos
&=
~
1
;
next_pos
&=
~
1
;
...
@@ -254,6 +257,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -254,6 +257,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
bink
->
remain_packet_size
=
st
->
index_entries
[
index_entry
].
size
;
bink
->
remain_packet_size
=
st
->
index_entries
[
index_entry
].
size
;
bink
->
flags
=
st
->
index_entries
[
index_entry
].
flags
;
bink
->
current_track
=
0
;
bink
->
current_track
=
0
;
}
}
...
@@ -290,6 +294,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -290,6 +294,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return
ret
;
return
ret
;
pkt
->
stream_index
=
0
;
pkt
->
stream_index
=
0
;
pkt
->
pts
=
bink
->
video_pts
++
;
pkt
->
pts
=
bink
->
video_pts
++
;
if
(
bink
->
flags
&
AVINDEX_KEYFRAME
)
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
/* -1 instructs the next call to read_packet() to read the next frame */
/* -1 instructs the next call to read_packet() to read the next frame */
...
...
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