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
2a89afb3
Commit
2a89afb3
authored
Nov 24, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/libxvid: return meaningful error codes
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
e29153f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
libxvid.c
libavcodec/libxvid.c
+11
-4
No files found.
libavcodec/libxvid.c
View file @
2a89afb3
...
...
@@ -488,6 +488,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
;
}
x
->
twopassbuffer
[
0
]
=
...
...
@@ -501,8 +502,9 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
rc2pass2
.
bitrate
=
avctx
->
bit_rate
;
fd
=
av_tempfile
(
"xvidff."
,
&
x
->
twopassfile
,
0
,
avctx
);
if
(
fd
==
-
1
)
{
if
(
fd
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
ret
=
fd
;
goto
fail
;
}
x
->
twopassfd
=
fd
;
...
...
@@ -510,14 +512,19 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
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
;
}
if
(
strlen
(
avctx
->
stats_in
)
>
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
)))
{
ret
=
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
));
if
(
ret
==
-
1
)
ret
=
AVERROR
(
errno
);
else
if
(
strlen
(
avctx
->
stats_in
)
>
ret
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write to 2-pass pipe
\n
"
);
goto
fail
;
ret
=
AVERROR
(
EIO
)
;
}
if
(
ret
<
0
)
goto
fail
;
rc2pass2
.
filename
=
x
->
twopassfile
;
plugins
[
xvid_enc_create
.
num_plugins
].
func
=
xvid_plugin_2pass2
;
...
...
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