Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
c2c7ad1d
Commit
c2c7ad1d
authored
Jun 25, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSOutputStream: more error handling
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
5100e1af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
hlsoutputstream.cc
src/hlsoutputstream.cc
+5
-16
No files found.
src/hlsoutputstream.cc
View file @
c2c7ad1d
...
...
@@ -156,10 +156,7 @@ HLSOutputStream::open_audio (AVCodec *codec, AVDictionary *opt_arg)
ret
=
avcodec_open2
(
m_enc
,
codec
,
&
opt
);
av_dict_free
(
&
opt
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Could not open audio codec: %s
\n
"
,
av_err2str
(
ret
));
exit
(
1
);
}
return
Error
(
string_printf
(
"could not open audio codec: %s"
,
av_err2str
(
ret
)));
if
(
m_enc
->
codec
->
capabilities
&
AV_CODEC_CAP_VARIABLE_FRAME_SIZE
)
nb_samples
=
10000
;
...
...
@@ -178,18 +175,12 @@ HLSOutputStream::open_audio (AVCodec *codec, AVDictionary *opt_arg)
/* copy the stream parameters to the muxer */
ret
=
avcodec_parameters_from_context
(
m_st
->
codecpar
,
m_enc
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Could not copy the stream parameters
\n
"
);
exit
(
1
);
}
return
Error
(
"could not copy the stream parameters"
);
/* create resampler context */
m_swr_ctx
=
swr_alloc
();
if
(
!
m_swr_ctx
)
{
fprintf
(
stderr
,
"Could not allocate resampler context
\n
"
);
exit
(
1
);
}
return
Error
(
"could not allocate resampler context"
);
/* set options */
av_opt_set_int
(
m_swr_ctx
,
"in_channel_count"
,
m_enc
->
channels
,
0
);
...
...
@@ -201,10 +192,8 @@ HLSOutputStream::open_audio (AVCodec *codec, AVDictionary *opt_arg)
/* initialize the resampling context */
if
((
ret
=
swr_init
(
m_swr_ctx
))
<
0
)
{
fprintf
(
stderr
,
"Failed to initialize the resampling context
\n
"
);
exit
(
1
);
}
return
Error
(
"failed to initialize the resampling context"
);
return
Error
::
Code
::
NONE
;
}
...
...
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