Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
443e9191
Commit
443e9191
authored
Feb 19, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed seeking on a sample described by the last STSS entry (.mp4).
parent
7f485903
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
26 deletions
+17
-26
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+17
-26
No files found.
modules/demux/mp4/mp4.c
View file @
443e9191
...
...
@@ -1899,7 +1899,7 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
uint32_t
*
pi_sample
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
MP4_Box_t
*
p_stss
;
MP4_Box_t
*
p_
box_
stss
;
uint64_t
i_dts
;
unsigned
int
i_sample
;
unsigned
int
i_chunk
;
...
...
@@ -2004,43 +2004,34 @@ static int TrackTimeToSampleChunk( demux_t *p_demux, mp4_track_t *p_track,
/* *** Try to find nearest sync points *** */
if
(
(
p_stss
=
MP4_BoxGet
(
p_track
->
p_stbl
,
"stss"
)
)
)
if
(
(
p_
box_
stss
=
MP4_BoxGet
(
p_track
->
p_stbl
,
"stss"
)
)
)
{
unsigned
int
i_index
;
msg_Dbg
(
p_demux
,
"track[Id 0x%x] using Sync Sample Box (stss)"
,
p_track
->
i_track_ID
);
for
(
i_index
=
0
;
i_index
<
p_stss
->
data
.
p_stss
->
i_entry_count
;
i_index
++
)
MP4_Box_data_stss_t
*
p_stss
=
p_box_stss
->
data
.
p_stss
;
msg_Dbg
(
p_demux
,
"track[Id 0x%x] using Sync Sample Box (stss)"
,
p_track
->
i_track_ID
);
for
(
unsigned
i_index
=
0
;
i_index
<
p_stss
->
i_entry_count
;
i_index
++
)
{
if
(
p_stss
->
data
.
p_stss
->
i_sample_number
[
i_index
]
>=
i_sample
)
if
(
i_index
>=
p_stss
->
i_entry_count
-
1
||
i_sample
<
p_stss
->
i_sample_number
[
i_index
+
1
]
)
{
if
(
i_index
>
0
)
unsigned
i_sync_sample
=
p_stss
->
i_sample_number
[
i_index
];
msg_Dbg
(
p_demux
,
"stts gives %d --> %d (sample number)"
,
i_sample
,
i_sync_sample
);
if
(
i_sync_sample
<=
i_sample
)
{
msg_Dbg
(
p_demux
,
"stts gives %d --> %d (sample number)"
,
i_sample
,
p_stss
->
data
.
p_stss
->
i_sample_number
[
i_index
-
1
]
);
i_sample
=
p_stss
->
data
.
p_stss
->
i_sample_number
[
i_index
-
1
];
/* new i_sample is less than old so i_chunk can only decreased */
while
(
i_chunk
>
0
&&
i_sample
<
p_track
->
chunk
[
i_chunk
].
i_sample_first
)
{
i_sync_sample
<
p_track
->
chunk
[
i_chunk
].
i_sample_first
)
i_chunk
--
;
}
}
else
{
msg_Dbg
(
p_demux
,
"stts gives %d --> %d (sample number)"
,
i_sample
,
p_stss
->
data
.
p_stss
->
i_sample_number
[
i_index
]
);
i_sample
=
p_stss
->
data
.
p_stss
->
i_sample_number
[
i_index
];
/* new i_sample is more than old so i_chunk can only increased */
while
(
i_chunk
<
p_track
->
i_chunk_count
-
1
&&
i_sample
>=
p_track
->
chunk
[
i_chunk
].
i_sample_first
+
p_track
->
chunk
[
i_chunk
].
i_sample_count
)
{
i_sync_sample
>=
p_track
->
chunk
[
i_chunk
].
i_sample_first
+
p_track
->
chunk
[
i_chunk
].
i_sample_count
)
i_chunk
++
;
}
}
i_sample
=
i_sync_sample
;
break
;
}
}
...
...
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