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
2c923983
Commit
2c923983
authored
Nov 28, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qpeg: reset palette on seeks
Fixes Ticket1921 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2754dbb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
qpeg.c
libavcodec/qpeg.c
+15
-0
No files found.
libavcodec/qpeg.c
View file @
2c923983
...
...
@@ -301,6 +301,18 @@ static int decode_frame(AVCodecContext *avctx,
return
avpkt
->
size
;
}
static
void
decode_flush
(
AVCodecContext
*
avctx
){
QpegContext
*
const
a
=
avctx
->
priv_data
;
int
i
,
pal_size
;
const
uint8_t
*
pal_src
;
pal_size
=
FFMIN
(
1024U
,
avctx
->
extradata_size
);
pal_src
=
avctx
->
extradata
+
avctx
->
extradata_size
-
pal_size
;
for
(
i
=
0
;
i
<
pal_size
/
4
;
i
++
)
a
->
pal
[
i
]
=
0xFFU
<<
24
|
AV_RL32
(
pal_src
+
4
*
i
);
}
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
){
QpegContext
*
const
a
=
avctx
->
priv_data
;
...
...
@@ -309,6 +321,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
a
->
avctx
=
avctx
;
avctx
->
pix_fmt
=
AV_PIX_FMT_PAL8
;
decode_flush
(
avctx
);
return
0
;
}
...
...
@@ -333,6 +347,7 @@ AVCodec ff_qpeg_decoder = {
.
init
=
decode_init
,
.
close
=
decode_end
,
.
decode
=
decode_frame
,
.
flush
=
decode_flush
,
.
capabilities
=
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Q-team QPEG"
),
};
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