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
0a80b397
Commit
0a80b397
authored
Nov 30, 2018
by
Karthick J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: Added proper logging when io_open fails for write
parent
416dc9a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
dashenc.c
libavformat/dashenc.c
+13
-6
No files found.
libavformat/dashenc.c
View file @
0a80b397
...
...
@@ -209,6 +209,15 @@ static const char *get_format_str(SegmentType segment_type) {
return
NULL
;
}
static
int
handle_io_open_error
(
AVFormatContext
*
s
,
int
err
,
char
*
url
)
{
DASHContext
*
c
=
s
->
priv_data
;
char
errbuf
[
AV_ERROR_MAX_STRING_SIZE
];
av_strerror
(
err
,
errbuf
,
sizeof
(
errbuf
));
av_log
(
s
,
c
->
ignore_io_errors
?
AV_LOG_WARNING
:
AV_LOG_ERROR
,
"Unable to open %s for writing: %s
\n
"
,
url
,
errbuf
);
return
c
->
ignore_io_errors
?
0
:
err
;
}
static
inline
SegmentType
select_segment_type
(
SegmentType
segment_type
,
enum
AVCodecID
codec_id
)
{
if
(
segment_type
==
SEGMENT_TYPE_AUTO
)
{
...
...
@@ -538,7 +547,7 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, AVFormatCont
ret
=
dashenc_io_open
(
s
,
&
c
->
m3u8_out
,
temp_filename_hls
,
&
http_opts
);
av_dict_free
(
&
http_opts
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to open %s for writing
\n
"
,
temp_filename_hls
);
handle_io_open_error
(
s
,
ret
,
temp_filename_hls
);
return
;
}
for
(
i
=
start_index
;
i
<
os
->
nb_segments
;
i
++
)
{
...
...
@@ -853,8 +862,7 @@ static int write_manifest(AVFormatContext *s, int final)
ret
=
dashenc_io_open
(
s
,
&
c
->
mpd_out
,
temp_filename
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to open %s for writing
\n
"
,
temp_filename
);
return
c
->
ignore_io_errors
?
0
:
ret
;
return
handle_io_open_error
(
s
,
ret
,
temp_filename
);
}
out
=
c
->
mpd_out
;
avio_printf
(
out
,
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>
\n
"
);
...
...
@@ -944,8 +952,7 @@ static int write_manifest(AVFormatContext *s, int final)
ret
=
dashenc_io_open
(
s
,
&
c
->
m3u8_out
,
temp_filename
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to open %s for writing
\n
"
,
temp_filename
);
return
c
->
ignore_io_errors
?
0
:
ret
;
return
handle_io_open_error
(
s
,
ret
,
temp_filename
);
}
ff_hls_write_playlist_version
(
c
->
m3u8_out
,
7
);
...
...
@@ -1578,7 +1585,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
ret
=
dashenc_io_open
(
s
,
&
os
->
out
,
os
->
temp_path
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
{
return
c
->
ignore_io_errors
?
0
:
ret
;
return
handle_io_open_error
(
s
,
ret
,
os
->
temp_path
)
;
}
}
...
...
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