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
b10c33a1
Commit
b10c33a1
authored
Jun 29, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSOutputStream: avoid using deprecated API
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
7152f3fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
hlsoutputstream.cc
src/hlsoutputstream.cc
+26
-6
No files found.
src/hlsoutputstream.cc
View file @
b10c33a1
...
...
@@ -285,15 +285,36 @@ HLSOutputStream::write_audio_frame (Error& err)
m_samples_count
+=
dst_nb_samples
;
}
ret
=
avcodec_encode_audio2
(
m_enc
,
&
pkt
,
frame
,
&
got_packet
);
if
(
ret
<
0
)
ret
=
avcodec_send_frame
(
m_enc
,
frame
);
if
(
ret
==
AVERROR_EOF
)
{
/* encoder has nothing more to do */
return
1
;
}
else
if
(
ret
<
0
)
{
err
=
Error
(
string_printf
(
"error encoding audio frame: %s"
,
av_err2str
(
ret
)));
return
1
;
}
if
(
got_packet
)
for
(;;)
{
ret
=
avcodec_receive_packet
(
m_enc
,
&
pkt
);
if
(
ret
==
AVERROR
(
EAGAIN
))
{
/* encoder needs more data to produce something */
return
0
;
}
else
if
(
ret
==
AVERROR_EOF
)
{
return
1
;
/* done */
}
else
if
(
ret
<
0
)
{
err
=
Error
(
string_printf
(
"error while encoding audio frame: %s"
,
av_err2str
(
ret
)));
return
1
;
}
/* one packet available */
if
(
m_cut_aac_frames
)
{
m_cut_aac_frames
--
;
...
...
@@ -308,9 +329,8 @@ HLSOutputStream::write_audio_frame (Error& err)
}
m_keep_aac_frames
--
;
}
return
0
;
/* not done yet */
}
return
(
frame
||
got_packet
)
?
0
:
1
;
}
void
...
...
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