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
4f0d4acc
Commit
4f0d4acc
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
libxvid: cleanup on error pathes
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
667bf156
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
+10
-5
10 additions, 5 deletions
libavcodec/libxvid.c
with
10 additions
and
5 deletions
libavcodec/libxvid.c
+
10
−
5
View file @
4f0d4acc
...
@@ -73,6 +73,8 @@ struct xvid_ff_pass1 {
...
@@ -73,6 +73,8 @@ struct xvid_ff_pass1 {
struct
xvid_context
*
context
;
/**< Pointer to private context */
struct
xvid_context
*
context
;
/**< Pointer to private context */
};
};
static
int
xvid_encode_close
(
AVCodecContext
*
avctx
);
/*
/*
* Xvid 2-Pass Kludge Section
* Xvid 2-Pass Kludge Section
*
*
...
@@ -477,7 +479,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
...
@@ -477,7 +479,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
if
(
x
->
twopassbuffer
==
NULL
||
x
->
old_twopassbuffer
==
NULL
)
{
if
(
x
->
twopassbuffer
==
NULL
||
x
->
old_twopassbuffer
==
NULL
)
{
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
"
);
return
-
1
;
goto
fail
;
}
}
x
->
twopassbuffer
[
0
]
=
x
->
old_twopassbuffer
[
0
]
=
0
;
x
->
twopassbuffer
[
0
]
=
x
->
old_twopassbuffer
[
0
]
=
0
;
...
@@ -492,21 +494,21 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
...
@@ -492,21 +494,21 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
if
(
fd
==
-
1
)
{
if
(
fd
==
-
1
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
"Xvid: Cannot write 2-pass pipe
\n
"
);
return
-
1
;
goto
fail
;
}
}
x
->
twopassfd
=
fd
;
x
->
twopassfd
=
fd
;
if
(
avctx
->
stats_in
==
NULL
)
{
if
(
avctx
->
stats_in
==
NULL
)
{
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
"
);
return
-
1
;
goto
fail
;
}
}
if
(
strlen
(
avctx
->
stats_in
)
>
if
(
strlen
(
avctx
->
stats_in
)
>
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
))
)
{
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
))
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write to 2-pass pipe
\n
"
);
"Xvid: Cannot write to 2-pass pipe
\n
"
);
return
-
1
;
goto
fail
;
}
}
rc2pass2
.
filename
=
x
->
twopassfile
;
rc2pass2
.
filename
=
x
->
twopassfile
;
...
@@ -606,13 +608,16 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
...
@@ -606,13 +608,16 @@ 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
"
);
return
-
1
;
goto
fail
;
}
}
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
x
->
encoder_handle
=
xvid_enc_create
.
handle
;
avctx
->
coded_frame
=
&
x
->
encoded_picture
;
avctx
->
coded_frame
=
&
x
->
encoded_picture
;
return
0
;
return
0
;
fail:
xvid_encode_close
(
avctx
);
return
-
1
;
}
}
static
int
xvid_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
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