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
161e4b9b
Commit
161e4b9b
authored
Jun 23, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testhls: support hls-mark write to file again
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
e57f6a06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
testhls.cc
src/testhls.cc
+7
-3
No files found.
src/testhls.cc
View file @
161e4b9b
...
...
@@ -446,13 +446,17 @@ static void close_stream(AVFormatContext *oc, OutputStream *ost)
Error
ff_encode
(
const
WavData
&
wav_data
,
const
string
&
filename
,
size_t
start_pos
,
size_t
cut_start
,
size_t
cut_end
,
double
pts_start
)
ff_encode
(
const
WavData
&
wav_data
,
const
string
&
out_
filename
,
size_t
start_pos
,
size_t
cut_start
,
size_t
cut_end
,
double
pts_start
)
{
string
filename
=
out_filename
;
if
(
filename
==
"-"
)
filename
=
"pipe:1"
;
AVFormatContext
*
oc
;
avformat_alloc_output_context2
(
&
oc
,
NULL
,
"mpegts"
,
NULL
);
if
(
!
oc
)
return
Error
(
"failed to alloc avformat output context"
);
int
ret
=
avio_open
(
&
oc
->
pb
,
"pipe:1"
,
AVIO_FLAG_WRITE
);
int
ret
=
avio_open
(
&
oc
->
pb
,
filename
.
c_str
()
,
AVIO_FLAG_WRITE
);
if
(
ret
<
0
)
{
error
(
"Could not open output: %s
\n
"
,
av_err2str
(
ret
));
...
...
@@ -476,7 +480,7 @@ ff_encode (const WavData& wav_data, const string& filename, size_t start_pos, si
error
(
"Error occurred when writing output file: %s
\n
"
,
av_err2str
(
ret
));
return
Error
(
"avformat_write_header failed
\n
"
);
}
av_dump_format
(
oc
,
0
,
"pipe:1"
,
1
);
av_dump_format
(
oc
,
0
,
filename
.
c_str
()
,
1
);
while
(
write_audio_frame
(
oc
,
&
audio_st
)
==
0
);
av_write_trailer
(
oc
);
...
...
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