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
dda0d1bc
Commit
dda0d1bc
authored
May 10, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testhls: tweak ffmpeg cut_start / length formatting code again
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
fdce8a1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
testhls.cc
src/testhls.cc
+2
-5
No files found.
src/testhls.cc
View file @
dda0d1bc
...
...
@@ -106,14 +106,11 @@ ff_encode (const WavData& wav_data, const string& filename, size_t start_pos, si
double
length_s
=
double
(
wav_data
.
n_values
())
/
wav_data
.
n_channels
()
/
wav_data
.
sample_rate
();
/* subtracting/adding 0.000001 from/to cut_start_s ensures that rounding
* performed by printf() doesn't accidentally cut one frame more or less than
* intended
*/
// cut_start_s is corrected down to avoid cutting one frame more or than intended
double
cut_start_s
=
cut_start
/
double
(
wav_data
.
sample_rate
());
double
cut_end_s
=
cut_end
/
double
(
wav_data
.
sample_rate
());
cmd
=
string_printf
(
"ffmpeg -v error -y -i '%s' -ss %.6f -t %.6f -f mpegts -output_ts_offset %f -muxdelay 0 -muxpreload 0 -c copy '%s-tcpy'"
,
filename
.
c_str
(),
cut_start_s
-
0.000001
,
length_s
-
(
cut_start_s
+
cut_end_s
)
+
0.000001
,
pts_start
,
filename
.
c_str
());
filename
.
c_str
(),
cut_start_s
-
1.
/
wav_data
.
sample_rate
(),
length_s
-
(
cut_start_s
+
cut_end_s
)
,
pts_start
,
filename
.
c_str
());
err
=
xsystem
(
cmd
);
if
(
err
)
return
err
;
...
...
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