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
a1e2c47c
Commit
a1e2c47c
authored
Feb 10, 2015
by
Himangi Saraogi
Committed by
Vittorio Giovara
Feb 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libxvid: Return meaningful error messages
parent
18f4fa25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
libxvid.c
libavcodec/libxvid.c
+6
-6
libxvid_rc.c
libavcodec/libxvid_rc.c
+4
-4
No files found.
libavcodec/libxvid.c
View file @
a1e2c47c
...
...
@@ -474,7 +474,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
"
);
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
}
x
->
twopassbuffer
[
0
]
=
x
->
old_twopassbuffer
[
0
]
=
0
;
...
...
@@ -487,22 +487,22 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
rc2pass2
.
bitrate
=
avctx
->
bit_rate
;
fd
=
ff_tempfile
(
"xvidff."
,
&
x
->
twopassfile
);
if
(
fd
==
-
1
)
{
if
(
fd
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write 2-pass pipe
\n
"
);
return
-
1
;
return
fd
;
}
if
(
!
avctx
->
stats_in
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: No 2-pass information loaded for second pass
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
strlen
(
avctx
->
stats_in
)
>
write
(
fd
,
avctx
->
stats_in
,
strlen
(
avctx
->
stats_in
)))
{
close
(
fd
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Cannot write to 2-pass pipe
\n
"
);
return
-
1
;
return
AVERROR
(
EIO
)
;
}
close
(
fd
);
...
...
@@ -770,7 +770,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return
0
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Xvid: Encoding Error Occurred: %i
\n
"
,
xerr
);
return
-
1
;
return
xerr
;
}
}
...
...
libavcodec/libxvid_rc.c
View file @
a1e2c47c
...
...
@@ -52,7 +52,7 @@ int ff_tempfile(const char *prefix, char **filename)
/* -----common section-----*/
if
(
!
(
*
filename
))
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot allocate file name
\n
"
);
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
}
#if !HAVE_MKSTEMP
fd
=
avpriv_open
(
*
filename
,
O_RDWR
|
O_BINARY
|
O_CREAT
,
0444
);
...
...
@@ -67,7 +67,7 @@ int ff_tempfile(const char *prefix, char **filename)
/* -----common section-----*/
if
(
fd
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"ff_tempfile: Cannot open temporary file %s
\n
"
,
*
filename
);
return
-
1
;
return
AVERROR
(
EIO
)
;
}
return
fd
;
/* success */
}
...
...
@@ -80,9 +80,9 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s)
xvid_plugin_2pass2_t
xvid_2pass2
=
{
0
};
fd
=
ff_tempfile
(
"xvidrc."
,
&
tmp_name
);
if
(
fd
==
-
1
)
{
if
(
fd
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Can't create temporary pass2 file.
\n
"
);
return
-
1
;
return
fd
;
}
for
(
i
=
0
;
i
<
s
->
rc_context
.
num_entries
;
i
++
)
{
...
...
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