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
d6f96108
Commit
d6f96108
authored
Mar 24, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yop: use reget_buffer() as the previous contents are used
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7239b360
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
yop.c
libavcodec/yop.c
+16
-2
No files found.
libavcodec/yop.c
View file @
d6f96108
...
...
@@ -31,6 +31,7 @@
typedef
struct
YopDecContext
{
AVCodecContext
*
avctx
;
AVFrame
*
frame
;
int
num_pal_colors
;
int
first_color
[
2
];
...
...
@@ -78,6 +79,13 @@ static const int8_t motion_vector[16][2] =
{
4
,
-
2
},
{
-
2
,
0
},
};
static
av_cold
void
yop_decode_close
(
AVCodecContext
*
avctx
)
{
YopDecContext
*
s
=
avctx
->
priv_data
;
av_frame_free
(
&
s
->
frame
);
}
static
av_cold
int
yop_decode_init
(
AVCodecContext
*
avctx
)
{
YopDecContext
*
s
=
avctx
->
priv_data
;
...
...
@@ -107,6 +115,8 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
return
AVERROR_INVALIDDATA
;
}
s
->
frame
=
av_frame_alloc
();
return
0
;
}
...
...
@@ -178,7 +188,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket
*
avpkt
)
{
YopDecContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
frame
=
data
;
AVFrame
*
frame
=
s
->
frame
;
int
tag
,
firstcolor
,
is_odd_frame
;
int
ret
,
i
,
x
,
y
;
uint32_t
*
palette
;
...
...
@@ -188,7 +198,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
AVERROR_INVALIDDATA
;
}
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
0
))
<
0
)
if
((
ret
=
ff_
reget_buffer
(
avctx
,
frame
))
<
0
)
return
ret
;
if
(
!
avctx
->
frame_number
)
...
...
@@ -242,6 +252,9 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s
->
dstptr
+=
2
*
frame
->
linesize
[
0
]
-
x
;
}
if
((
ret
=
av_frame_ref
(
data
,
s
->
frame
))
<
0
)
return
ret
;
*
got_frame
=
1
;
return
avpkt
->
size
;
}
...
...
@@ -252,6 +265,7 @@ AVCodec ff_yop_decoder = {
.
id
=
AV_CODEC_ID_YOP
,
.
priv_data_size
=
sizeof
(
YopDecContext
),
.
init
=
yop_decode_init
,
.
close
=
yop_decode_close
,
.
decode
=
yop_decode_frame
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Psygnosis YOP Video"
),
};
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