Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
0ecda63f
Commit
0ecda63f
authored
Jun 17, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: try to detect non interleaved content prior playback
parent
349164dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
+30
-7
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+30
-7
No files found.
modules/demux/mp4/mp4.c
View file @
0ecda63f
...
...
@@ -130,6 +130,7 @@ static uint64_t MP4_TrackGetPos ( mp4_track_t * );
static
uint32_t
MP4_TrackGetReadSize
(
mp4_track_t
*
,
uint32_t
*
);
static
int
MP4_TrackNextSample
(
demux_t
*
,
mp4_track_t
*
,
uint32_t
);
static
void
MP4_TrackSetELST
(
demux_t
*
,
mp4_track_t
*
,
int64_t
);
static
bool
MP4_TrackIsInterleaved
(
const
mp4_track_t
*
);
static
void
MP4_UpdateSeekpoint
(
demux_t
*
);
...
...
@@ -943,6 +944,20 @@ static int Open( vlc_object_t * p_this )
}
#endif
if
(
!
p_sys
->
b_fragmented
&&
p_sys
->
i_tracks
>
1
&&
p_sys
->
b_seekable
&&
!
p_sys
->
b_seekmode
)
{
for
(
unsigned
i
=
0
;
i
<
p_sys
->
i_tracks
;
i
++
)
{
mp4_track_t
*
tk
=
&
p_sys
->
track
[
i
];
if
(
!
MP4_TrackIsInterleaved
(
tk
)
)
{
msg_Warn
(
p_demux
,
"that media doesn't look interleaved, will need to seek"
);
p_sys
->
b_seekmode
=
true
;
break
;
}
}
}
/* */
LoadChapter
(
p_demux
);
...
...
@@ -1161,13 +1176,6 @@ end:
mtime_t
i_dts
=
MP4_TrackGetDTS
(
p_demux
,
tk
);
p_sys
->
i_pcr
=
__MIN
(
i_dts
,
p_sys
->
i_pcr
);
if
(
!
p_sys
->
b_seekmode
&&
i_dts
>
p_sys
->
i_pcr
+
2
*
CLOCK_FREQ
)
{
msg_Dbg
(
p_demux
,
"that media doesn't look interleaved, will need to seek"
);
p_sys
->
b_seekmode
=
true
;
}
p_sys
->
i_time
=
p_sys
->
i_pcr
*
p_sys
->
i_timescale
/
CLOCK_FREQ
;
}
}
...
...
@@ -1840,6 +1848,21 @@ static void LoadChapter( demux_t *p_demux )
}
}
static
bool
MP4_TrackIsInterleaved
(
const
mp4_track_t
*
p_track
)
{
const
MP4_Box_t
*
p_stsc
=
MP4_BoxGet
(
p_track
->
p_stbl
,
"stsc"
);
const
MP4_Box_t
*
p_stsz
=
MP4_BoxGet
(
p_track
->
p_stbl
,
"stsz"
);
if
(
p_stsc
&&
BOXDATA
(
p_stsc
)
&&
p_stsz
&&
BOXDATA
(
p_stsz
)
)
{
if
(
BOXDATA
(
p_stsc
)
->
i_entry_count
==
1
&&
BOXDATA
(
p_stsz
)
->
i_sample_count
>
1
&&
BOXDATA
(
p_stsc
)
->
i_samples_per_chunk
[
0
]
==
BOXDATA
(
p_stsz
)
->
i_sample_count
)
return
false
;
}
return
true
;
}
/* now create basic chunk data, the rest will be filled by MP4_CreateSamplesIndex */
static
int
TrackCreateChunksIndex
(
demux_t
*
p_demux
,
mp4_track_t
*
p_demux_track
)
...
...
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