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
1782a840
Commit
1782a840
authored
Jun 23, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testhls: re-add aac encoder cut_start and cut_end
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
161e4b9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
testhls.cc
src/testhls.cc
+22
-8
No files found.
src/testhls.cc
View file @
1782a840
...
...
@@ -122,6 +122,8 @@ struct OutputStream {
const
WavData
*
wav_data
=
nullptr
;
int64_t
t
;
size_t
cut_frames_start
=
0
;
size_t
keep_frames
=
0
;
struct
SwsContext
*
sws_ctx
;
struct
SwrContext
*
swr_ctx
;
...
...
@@ -424,13 +426,23 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
exit
(
1
);
}
if
(
got_packet
)
{
if
(
got_packet
)
{
if
(
ost
->
cut_frames_start
)
{
ost
->
cut_frames_start
--
;
}
else
if
(
ost
->
keep_frames
)
{
ret
=
write_frame
(
oc
,
&
c
->
time_base
,
ost
->
st
,
&
pkt
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error while writing audio frame: %s
\n
"
,
av_err2str
(
ret
));
exit
(
1
);
}
ost
->
keep_frames
--
;
}
}
return
(
frame
||
got_packet
)
?
0
:
1
;
...
...
@@ -465,6 +477,8 @@ ff_encode (const WavData& wav_data, const string& out_filename, size_t start_pos
OutputStream
audio_st
=
{
0
};
audio_st
.
wav_data
=
&
wav_data
;
audio_st
.
cut_frames_start
=
cut_start
/
1024
;
audio_st
.
keep_frames
=
(
wav_data
.
n_values
()
/
wav_data
.
n_channels
()
-
cut_start
-
cut_end
)
/
1024
;
AVCodec
*
audio_codec
;
AVOutputFormat
*
fmt
;
AVDictionary
*
opt
=
nullptr
;
...
...
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