Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
23199719
Commit
23199719
authored
Aug 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mp4v2: use integer seek times
parent
a606ef07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Mp4v2DecoderPlugin.cxx
src/decoder/plugins/Mp4v2DecoderPlugin.cxx
+7
-4
No files found.
src/decoder/plugins/Mp4v2DecoderPlugin.cxx
View file @
23199719
...
...
@@ -148,7 +148,7 @@ mp4_file_decode(Decoder &mpd_decoder, Path path_fs)
/* initialize the MPD core */
const
uint32_t
scale
=
MP4GetTrackTimeScale
(
handle
,
track
);
const
MP4Timestamp
scale
=
MP4GetTrackTimeScale
(
handle
,
track
);
const
float
duration
=
((
float
)
MP4GetTrackDuration
(
handle
,
track
))
/
scale
+
0.5
f
;
const
MP4SampleId
num_samples
=
MP4GetTrackNumberOfSamples
(
handle
,
track
);
...
...
@@ -165,9 +165,12 @@ mp4_file_decode(Decoder &mpd_decoder, Path path_fs)
unsigned
int
data_length
=
0
;
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
const
double
offset
=
decoder_seek_where
(
mpd_decoder
);
sample
=
MP4GetSampleIdFromTime
(
handle
,
track
,
(
MP4Timestamp
)(
offset
*
(
double
)
scale
),
0
);
const
unsigned
offset_ms
=
decoder_seek_where_ms
(
mpd_decoder
);
const
MP4Timestamp
offset
=
(
offset_ms
*
scale
)
/
1000
;
sample
=
MP4GetSampleIdFromTime
(
handle
,
track
,
offset
,
false
);
decoder_command_finished
(
mpd_decoder
);
}
...
...
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