Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4da8cdbb
Commit
4da8cdbb
authored
Jul 29, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tscc: Eliminate pointless variable indirections in decode_frame()
parent
5735552f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
tscc.c
libavcodec/tscc.c
+10
-12
No files found.
libavcodec/tscc.c
View file @
4da8cdbb
...
...
@@ -67,34 +67,32 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
CamtasiaContext
*
const
c
=
avctx
->
priv_data
;
const
unsigned
char
*
encoded
=
buf
;
AVFrame
*
frame
=
data
;
int
zret
;
// Zlib return code
int
ret
,
len
=
buf_size
;
int
ret
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
,
0
))
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
z
ret
=
inflateReset
(
&
c
->
zstream
);
if
(
z
ret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate reset error: %d
\n
"
,
z
ret
);
ret
=
inflateReset
(
&
c
->
zstream
);
if
(
ret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate reset error: %d
\n
"
,
ret
);
return
AVERROR_UNKNOWN
;
}
c
->
zstream
.
next_in
=
encoded
;
c
->
zstream
.
avail_in
=
len
;
c
->
zstream
.
next_in
=
buf
;
c
->
zstream
.
avail_in
=
buf_size
;
c
->
zstream
.
next_out
=
c
->
decomp_buf
;
c
->
zstream
.
avail_out
=
c
->
decomp_size
;
z
ret
=
inflate
(
&
c
->
zstream
,
Z_FINISH
);
ret
=
inflate
(
&
c
->
zstream
,
Z_FINISH
);
// Z_DATA_ERROR means empty picture
if
((
zret
!=
Z_OK
)
&&
(
zret
!=
Z_STREAM_END
)
&&
(
z
ret
!=
Z_DATA_ERROR
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate error: %d
\n
"
,
z
ret
);
if
((
ret
!=
Z_OK
)
&&
(
ret
!=
Z_STREAM_END
)
&&
(
ret
!=
Z_DATA_ERROR
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate error: %d
\n
"
,
ret
);
return
AVERROR_UNKNOWN
;
}
if
(
z
ret
!=
Z_DATA_ERROR
)
{
if
(
ret
!=
Z_DATA_ERROR
)
{
bytestream2_init
(
&
c
->
gb
,
c
->
decomp_buf
,
c
->
decomp_size
-
c
->
zstream
.
avail_out
);
ff_msrle_decode
(
avctx
,
(
AVPicture
*
)
frame
,
c
->
bpp
,
&
c
->
gb
);
...
...
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