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
c949a450
Commit
c949a450
authored
Apr 24, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libxvid: remove now redundant init cleanup code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
437bdf48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
libxvid.c
libavcodec/libxvid.c
+12
-25
No files found.
libavcodec/libxvid.c
View file @
c949a450
...
@@ -481,8 +481,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -481,8 +481,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
}
else
{
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Too small height for threads > 1."
);
"Too small height for threads > 1."
);
ret
=
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
goto
fail
;
}
}
}
}
#endif
#endif
...
@@ -503,8 +502,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -503,8 +502,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
if
(
!
x
->
twopassbuffer
||
!
x
->
old_twopassbuffer
)
{
if
(
!
x
->
twopassbuffer
||
!
x
->
old_twopassbuffer
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot allocate 2-pass log buffers
\n
"
);
"Xvid: Cannot allocate 2-pass log buffers
\n
"
);
ret
=
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
goto
fail
;
}
}
x
->
twopassbuffer
[
0
]
=
x
->
twopassbuffer
[
0
]
=
x
->
old_twopassbuffer
[
0
]
=
0
;
x
->
old_twopassbuffer
[
0
]
=
0
;
...
@@ -519,16 +517,14 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -519,16 +517,14 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
fd
=
av_tempfile
(
"xvidff."
,
&
x
->
twopassfile
,
0
,
avctx
);
fd
=
av_tempfile
(
"xvidff."
,
&
x
->
twopassfile
,
0
,
avctx
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
ret
=
fd
;
return
fd
;
goto
fail
;
}
}
x
->
twopassfd
=
fd
;
x
->
twopassfd
=
fd
;
if
(
!
avctx
->
stats_in
)
{
if
(
!
avctx
->
stats_in
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: No 2-pass information loaded for second pass
\n
"
);
"Xvid: No 2-pass information loaded for second pass
\n
"
);
ret
=
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
goto
fail
;
}
}
ret
=
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
));
ret
=
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
));
...
@@ -539,7 +535,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -539,7 +535,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
ret
=
AVERROR
(
EIO
);
ret
=
AVERROR
(
EIO
);
}
}
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
return
ret
;
rc2pass2
.
filename
=
x
->
twopassfile
;
rc2pass2
.
filename
=
x
->
twopassfile
;
plugins
[
xvid_enc_create
.
num_plugins
].
func
=
xvid_plugin_2pass2
;
plugins
[
xvid_enc_create
.
num_plugins
].
func
=
xvid_plugin_2pass2
;
...
@@ -627,19 +623,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -627,19 +623,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
if
(
avctx
->
intra_matrix
)
{
if
(
avctx
->
intra_matrix
)
{
intra
=
avctx
->
intra_matrix
;
intra
=
avctx
->
intra_matrix
;
x
->
intra_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
x
->
intra_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
if
(
!
x
->
intra_matrix
)
{
if
(
!
x
->
intra_matrix
)
ret
=
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
goto
fail
;
}
}
else
}
else
intra
=
NULL
;
intra
=
NULL
;
if
(
avctx
->
inter_matrix
)
{
if
(
avctx
->
inter_matrix
)
{
inter
=
avctx
->
inter_matrix
;
inter
=
avctx
->
inter_matrix
;
x
->
inter_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
x
->
inter_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
if
(
!
x
->
inter_matrix
)
{
if
(
!
x
->
inter_matrix
)
ret
=
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
goto
fail
;
}
}
else
}
else
inter
=
NULL
;
inter
=
NULL
;
...
@@ -684,20 +676,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
...
@@ -684,20 +676,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
xerr
=
xvid_encore
(
NULL
,
XVID_ENC_CREATE
,
&
xvid_enc_create
,
NULL
);
xerr
=
xvid_encore
(
NULL
,
XVID_ENC_CREATE
,
&
xvid_enc_create
,
NULL
);
if
(
xerr
)
{
if
(
xerr
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Could not create encoder reference
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Could not create encoder reference
\n
"
);
goto
fail
;
return
AVERROR_EXTERNAL
;
}
}
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
avctx
->
coded_frame
=
av_frame_alloc
();
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
avctx
->
coded_frame
)
{
if
(
!
avctx
->
coded_frame
)
ret
=
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
goto
fail
;
}
return
0
;
return
0
;
fail:
xvid_encode_close
(
avctx
);
return
ret
;
}
}
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
...
...
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