Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
5d66046d
Commit
5d66046d
authored
Jan 13, 2015
by
François Cartegnie
🤞
Browse files
demux: mp4: always use sidx on discontinuity
Should fix out-of-sync tracks with DASH
parent
08722cb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/demux/mp4/mp4.c
View file @
5d66046d
...
...
@@ -96,6 +96,7 @@ struct demux_sys_t
mp4_fragment_t
*
p_fragment
;
uint32_t
i_current_box_type
;
uint32_t
i_mdatbytesleft
;
uint32_t
i_lastseqnumber
;
}
context
;
/* */
...
...
@@ -592,6 +593,8 @@ static int Open( vlc_object_t * p_this )
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_sys
->
context
.
i_lastseqnumber
=
1
;
p_demux
->
p_sys
=
p_sys
;
if
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
24
)
<
24
)
return
VLC_EGENERIC
;
...
...
@@ -5034,19 +5037,14 @@ static int DemuxAsLeaf( demux_t *p_demux )
return
1
;
}
if
(
p_sys
->
b_dash
&&
p_sys
->
moovfragment
.
p_moox
&&
p_sys
->
moovfragment
.
p_next
)
MP4_Box_t
*
p_mfhd
=
MP4_BoxGet
(
p_fragbox
,
"mfhd"
);
if
(
p_mfhd
&&
BOXDATA
(
p_mfhd
)
)
{
/* Detect and Handle Passive Seek */
mp4_fragment_t
*
lastfrag
=
p_sys
->
moovfragment
.
p_next
;
while
(
lastfrag
->
p_next
)
lastfrag
=
lastfrag
->
p_next
;
MP4_Box_t
*
p_mfhd
=
MP4_BoxGet
(
p_fragbox
,
"mfhd"
);
MP4_Box_t
*
p_prevmfhd
=
MP4_BoxGet
(
lastfrag
->
p_moox
,
"mfhd"
);
if
(
p_mfhd
&&
p_prevmfhd
&&
BOXDATA
(
p_mfhd
)
->
i_sequence_number
!=
p_prevmfhd
->
data
.
p_mfhd
->
i_sequence_number
+
1
)
if
(
p_sys
->
context
.
i_lastseqnumber
+
1
!=
BOXDATA
(
p_mfhd
)
->
i_sequence_number
)
{
msg_Info
(
p_demux
,
"
Passive DASH Seek
detected %"
PRIu32
" %"
PRIu32
,
BOXDATA
(
p_mfhd
)
->
i_sequence_number
,
p_
prevmfhd
->
data
.
p_mfhd
->
i_sequence_
number
+
1
);
msg_Info
(
p_demux
,
"
Fragment sequence discontinuity
detected %"
PRIu32
"
!=
%"
PRIu32
,
BOXDATA
(
p_mfhd
)
->
i_sequence_number
,
p_
sys
->
context
.
i_lastseq
number
+
1
);
MP4_Box_t
*
p_sidx
=
MP4_BoxGet
(
p_vroot
,
"sidx"
);
if
(
p_sidx
&&
BOXDATA
(
p_sidx
)
&&
BOXDATA
(
p_sidx
)
->
i_timescale
)
{
...
...
@@ -5062,6 +5060,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
p_sys
->
i_pcr
=
VLC_TS_INVALID
;
}
}
p_sys
->
context
.
i_lastseqnumber
=
BOXDATA
(
p_mfhd
)
->
i_sequence_number
;
}
/* detach */
...
...
Write
Preview
Supports
Markdown
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