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
32f7cf9b
Commit
32f7cf9b
authored
Nov 09, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truemotion2: use the AVFrame API properly.
parent
42d40fd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
truemotion2.c
libavcodec/truemotion2.c
+8
-6
No files found.
libavcodec/truemotion2.c
View file @
32f7cf9b
...
...
@@ -58,7 +58,7 @@ enum TM2_BLOCKS {
typedef
struct
TM2Context
{
AVCodecContext
*
avctx
;
AVFrame
pic
;
AVFrame
*
pic
;
GetBitContext
gb
;
DSPContext
dsp
;
...
...
@@ -838,7 +838,7 @@ static int decode_frame(AVCodecContext *avctx,
TM2Context
*
const
l
=
avctx
->
priv_data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
&
~
3
;
AVFrame
*
const
p
=
&
l
->
pic
;
AVFrame
*
const
p
=
l
->
pic
;
int
offset
=
TM2_HEADER_SIZE
;
int
i
,
t
,
ret
;
uint8_t
*
swbuf
;
...
...
@@ -883,7 +883,7 @@ static int decode_frame(AVCodecContext *avctx,
l
->
cur
=
!
l
->
cur
;
*
got_frame
=
1
;
ret
=
av_frame_ref
(
data
,
&
l
->
pic
);
ret
=
av_frame_ref
(
data
,
l
->
pic
);
av_free
(
swbuf
);
return
(
ret
<
0
)
?
ret
:
buf_size
;
...
...
@@ -900,9 +900,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
l
->
avctx
=
avctx
;
avcodec_get_frame_defaults
(
&
l
->
pic
);
avctx
->
pix_fmt
=
AV_PIX_FMT_BGR24
;
l
->
pic
=
av_frame_alloc
();
if
(
!
l
->
pic
)
return
AVERROR
(
ENOMEM
);
ff_dsputil_init
(
&
l
->
dsp
,
avctx
);
l
->
last
=
av_malloc
(
4
*
sizeof
(
*
l
->
last
)
*
(
w
>>
2
));
...
...
@@ -952,7 +955,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
static
av_cold
int
decode_end
(
AVCodecContext
*
avctx
)
{
TM2Context
*
const
l
=
avctx
->
priv_data
;
AVFrame
*
pic
=
&
l
->
pic
;
int
i
;
av_free
(
l
->
last
);
...
...
@@ -968,7 +970,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
av_free
(
l
->
V2_base
);
}
av_frame_
unref
(
pic
);
av_frame_
free
(
&
l
->
pic
);
return
0
;
}
...
...
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