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
739b5090
Commit
739b5090
authored
Mar 09, 2010
by
David Conrad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vp3: Simplify buffer management
Originally committed as revision 22357 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
01f9640b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
26 deletions
+14
-26
vp3.c
libavcodec/vp3.c
+14
-26
No files found.
libavcodec/vp3.c
View file @
739b5090
...
...
@@ -1809,6 +1809,12 @@ static int vp3_decode_frame(AVCodecContext *avctx,
if
(
avctx
->
skip_frame
>=
AVDISCARD_NONKEY
&&
!
s
->
keyframe
)
return
buf_size
;
s
->
current_frame
.
reference
=
3
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
current_frame
)
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
}
if
(
s
->
keyframe
)
{
if
(
!
s
->
theora
)
{
...
...
@@ -1827,35 +1833,10 @@ static int vp3_decode_frame(AVCodecContext *avctx,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Warning, unsupported keyframe coding type?!
\n
"
);
skip_bits
(
&
gb
,
2
);
/* reserved? */
}
if
(
s
->
last_frame
.
data
[
0
]
==
s
->
golden_frame
.
data
[
0
])
{
if
(
s
->
golden_frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
golden_frame
);
s
->
last_frame
=
s
->
golden_frame
;
/* ensure that we catch any access to this released frame */
}
else
{
if
(
s
->
golden_frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
golden_frame
);
if
(
s
->
last_frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
last_frame
);
}
s
->
golden_frame
.
reference
=
3
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
golden_frame
)
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"vp3: get_buffer() failed
\n
"
);
return
-
1
;
}
/* golden frame is also the current frame */
s
->
current_frame
=
s
->
golden_frame
;
}
else
{
/* allocate a new current frame */
s
->
current_frame
.
reference
=
3
;
if
(
!
s
->
golden_frame
.
data
[
0
])
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"vp3: first frame not a keyframe
\n
"
);
return
-
1
;
}
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
current_frame
)
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"vp3: get_buffer() failed
\n
"
);
avctx
->
release_buffer
(
avctx
,
&
s
->
current_frame
);
return
-
1
;
}
}
...
...
@@ -1915,6 +1896,13 @@ static int vp3_decode_frame(AVCodecContext *avctx,
/* shuffle frames (last = current) */
s
->
last_frame
=
s
->
current_frame
;
if
(
s
->
keyframe
)
{
if
(
s
->
golden_frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
golden_frame
);
s
->
golden_frame
=
s
->
current_frame
;
}
s
->
current_frame
.
data
[
0
]
=
NULL
;
/* ensure that we catch any access to this released frame */
return
buf_size
;
...
...
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