Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
c949a450
Commit
c949a450
authored
9 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
avcodec/libxvid: remove now redundant init cleanup code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
437bdf48
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/libxvid.c
+12
-25
12 additions, 25 deletions
libavcodec/libxvid.c
with
12 additions
and
25 deletions
libavcodec/libxvid.c
+
12
−
25
View file @
c949a450
...
...
@@ -481,8 +481,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Too small height for threads > 1."
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
return
AVERROR
(
EINVAL
);
}
}
#endif
...
...
@@ -503,8 +502,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
if
(
!
x
->
twopassbuffer
||
!
x
->
old_twopassbuffer
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot allocate 2-pass log buffers
\n
"
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
return
AVERROR
(
ENOMEM
);
}
x
->
twopassbuffer
[
0
]
=
x
->
old_twopassbuffer
[
0
]
=
0
;
...
...
@@ -519,16 +517,14 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
fd
=
av_tempfile
(
"xvidff."
,
&
x
->
twopassfile
,
0
,
avctx
);
if
(
fd
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
ret
=
fd
;
goto
fail
;
return
fd
;
}
x
->
twopassfd
=
fd
;
if
(
!
avctx
->
stats_in
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: No 2-pass information loaded for second pass
\n
"
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
return
AVERROR
(
EINVAL
);
}
ret
=
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
));
...
...
@@ -539,7 +535,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
ret
=
AVERROR
(
EIO
);
}
if
(
ret
<
0
)
goto
fail
;
return
ret
;
rc2pass2
.
filename
=
x
->
twopassfile
;
plugins
[
xvid_enc_create
.
num_plugins
].
func
=
xvid_plugin_2pass2
;
...
...
@@ -627,19 +623,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
if
(
avctx
->
intra_matrix
)
{
intra
=
avctx
->
intra_matrix
;
x
->
intra_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
if
(
!
x
->
intra_matrix
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
if
(
!
x
->
intra_matrix
)
return
AVERROR
(
ENOMEM
);
}
else
intra
=
NULL
;
if
(
avctx
->
inter_matrix
)
{
inter
=
avctx
->
inter_matrix
;
x
->
inter_matrix
=
av_malloc
(
sizeof
(
unsigned
char
)
*
64
);
if
(
!
x
->
inter_matrix
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
if
(
!
x
->
inter_matrix
)
return
AVERROR
(
ENOMEM
);
}
else
inter
=
NULL
;
...
...
@@ -684,20 +676,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
xerr
=
xvid_encore
(
NULL
,
XVID_ENC_CREATE
,
&
xvid_enc_create
,
NULL
);
if
(
xerr
)
{
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
;
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
avctx
->
coded_frame
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
if
(
!
avctx
->
coded_frame
)
return
AVERROR
(
ENOMEM
);
return
0
;
fail:
xvid_encode_close
(
avctx
);
return
ret
;
}
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment