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
fe65f510
Commit
fe65f510
authored
Jun 11, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: fix smooth restart
parent
d991fd3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
29 deletions
+40
-29
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+40
-29
No files found.
modules/demux/mp4/mp4.c
View file @
fe65f510
...
@@ -421,7 +421,6 @@ static int CreateTracksFromSmooBox( demux_t *p_demux )
...
@@ -421,7 +421,6 @@ static int CreateTracksFromSmooBox( demux_t *p_demux )
{
{
mp4_track_t
*
p_track
=
&
p_sys
->
track
[
j
++
];
mp4_track_t
*
p_track
=
&
p_sys
->
track
[
j
++
];
MP4_SmoothTrackCreate
(
p_demux
,
p_track
,
p_stra
);
MP4_SmoothTrackCreate
(
p_demux
,
p_track
,
p_stra
);
p_track
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
p_track
->
fmt
);
}
}
p_stra
=
p_stra
->
p_next
;
p_stra
=
p_stra
->
p_next
;
}
}
...
@@ -3509,6 +3508,7 @@ static int MP4_SmoothFormatFill( const MP4_Box_data_stra_t *p_data, const mp4_tr
...
@@ -3509,6 +3508,7 @@ static int MP4_SmoothFormatFill( const MP4_Box_data_stra_t *p_data, const mp4_tr
static
int
MP4_SmoothTrackCreate
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
,
const
MP4_Box_t
*
p_stra
)
static
int
MP4_SmoothTrackCreate
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
,
const
MP4_Box_t
*
p_stra
)
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
es_format_t
*
fmt
=
&
p_track
->
fmt
;
p_track
->
b_ok
=
false
;
p_track
->
b_ok
=
false
;
p_track
->
b_selected
=
false
;
p_track
->
b_selected
=
false
;
...
@@ -3521,16 +3521,36 @@ static int MP4_SmoothTrackCreate( demux_t *p_demux, mp4_track_t *p_track, const
...
@@ -3521,16 +3521,36 @@ static int MP4_SmoothTrackCreate( demux_t *p_demux, mp4_track_t *p_track, const
p_track
->
i_timescale
=
p_sys
->
i_timescale
;
p_track
->
i_timescale
=
p_sys
->
i_timescale
;
p_track
->
i_track_ID
=
p_data
->
i_track_ID
;
p_track
->
i_track_ID
=
p_data
->
i_track_ID
;
p_track
->
i_width
=
0
;
p_track
->
i_height
=
0
;
es_format_t
*
fmt
=
&
p_track
->
fmt
;
es_format_t
newfmt
;
es_format_Init
(
&
p_track
->
fmt
,
p_data
->
i_es_cat
,
0
);
es_format_Init
(
&
newfmt
,
p_data
->
i_es_cat
,
0
);
if
(
MP4_SmoothFormatFill
(
BOXDATA
(
p_stra
),
p_track
,
&
newfmt
)
!=
VLC_SUCCESS
)
{
es_format_Clean
(
&
newfmt
);
if
(
p_track
->
p_es
)
{
es_out_Del
(
p_demux
->
out
,
p_track
->
p_es
);
p_track
->
p_es
=
NULL
;
}
return
VLC_EGENERIC
;
}
if
(
MP4_SmoothFormatFill
(
p_data
,
p_track
,
fmt
)
!=
VLC_SUCCESS
)
/* If format now differs from current (new or updated) */
if
(
!
es_format_IsSimilar
(
&
newfmt
,
fmt
)
||
newfmt
.
i_extra
!=
fmt
->
i_extra
||
memcmp
(
&
newfmt
.
p_extra
,
fmt
->
p_extra
,
newfmt
.
i_extra
)
)
{
{
es_format_Clean
(
fmt
);
es_format_Clean
(
fmt
);
return
VLC_EGENERIC
;
es_format_Copy
(
fmt
,
&
newfmt
);
if
(
p_track
->
p_es
)
es_out_Del
(
p_demux
->
out
,
p_track
->
p_es
);
p_track
->
p_es
=
es_out_Add
(
p_demux
->
out
,
fmt
);
}
}
else
if
(
fmt
->
i_cat
==
VIDEO_ES
)
es_format_Clean
(
&
newfmt
);
if
(
fmt
->
i_cat
==
VIDEO_ES
)
{
{
p_track
->
i_width
=
fmt
->
video
.
i_visible_width
;
p_track
->
i_width
=
fmt
->
video
.
i_visible_width
;
p_track
->
i_height
=
fmt
->
video
.
i_visible_height
;
p_track
->
i_height
=
fmt
->
video
.
i_visible_height
;
...
@@ -3544,7 +3564,7 @@ static int MP4_SmoothTrackCreate( demux_t *p_demux, mp4_track_t *p_track, const
...
@@ -3544,7 +3564,7 @@ static int MP4_SmoothTrackCreate( demux_t *p_demux, mp4_track_t *p_track, const
p_demux
->
p_sys
->
f_fps
=
24
;
p_demux
->
p_sys
->
f_fps
=
24
;
}
}
p_track
->
b_ok
=
true
;
p_track
->
b_ok
=
!!
p_track
->
p_es
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -3615,44 +3635,35 @@ static int ReInitDecoder( demux_t *p_demux, mp4_track_t *p_track )
...
@@ -3615,44 +3635,35 @@ static int ReInitDecoder( demux_t *p_demux, mp4_track_t *p_track )
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
uint32_t
i_sample
=
0
;
uint32_t
i_sample
=
p_track
->
i_sample
;
bool
b_smooth
=
false
;
MP4_Box_t
*
p_stra
=
NULL
,
*
p_trak
=
NULL
;
if
(
!
CmpUUID
(
&
p_sys
->
p_root
->
p_first
->
i_uuid
,
&
SmooBoxUUID
)
)
b_smooth
=
true
;
if
(
b_smooth
)
if
(
p_sys
->
b_smooth
)
{
{
p_stra
=
MP4_BoxGet
(
p_sys
->
p_root
,
"uuid/uuid[0]"
);
MP4_Box_t
*
p_stra
=
MP4_BoxGet
(
p_sys
->
p_root
,
"uuid/uuid[0]"
);
if
(
!
p_stra
||
CmpUUID
(
&
p_stra
->
i_uuid
,
&
StraBoxUUID
)
)
if
(
!
p_stra
||
CmpUUID
(
&
p_stra
->
i_uuid
,
&
StraBoxUUID
)
||
MP4_SmoothTrackCreate
(
p_demux
,
p_track
,
p_stra
)
!=
VLC_SUCCESS
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
else
/* DASH */
else
/* DASH */
{
{
p_trak
=
MP4_BoxGet
(
p_sys
->
p_root
,
"/moov/trak[0]"
);
MP4_Box_t
*
p_trak
=
MP4_BoxGet
(
p_sys
->
p_root
,
"/moov/trak[0]"
);
if
(
!
p_trak
)
if
(
!
p_trak
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
i_sample
=
p_track
->
i_sample
;
es_out_Del
(
p_demux
->
out
,
p_track
->
p_es
);
p_track
->
p_es
=
NULL
;
es_format_Clean
(
&
p_track
->
fmt
);
if
(
b_smooth
)
es_out_Del
(
p_demux
->
out
,
p_track
->
p_es
);
MP4_SmoothTrackCreate
(
p_demux
,
p_track
,
p_stra
)
;
p_track
->
p_es
=
NULL
;
else
/* DASH */
es_format_Clean
(
&
p_track
->
fmt
);
MP4_TrackCreate
(
p_demux
,
p_track
,
p_trak
,
true
);
MP4_TrackCreate
(
p_demux
,
p_track
,
p_trak
,
true
);
if
(
!
p_track
->
p_es
)
p_track
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
p_track
->
fmt
);
p_track
->
b_ok
=
!!
p_track
->
p_es
;
}
p_track
->
i_sample
=
i_sample
;
p_track
->
i_sample
=
i_sample
;
/* Temporary hack until we support track selection */
/* Temporary hack until we support track selection */
p_track
->
b_selected
=
true
;
p_track
->
b_selected
=
true
;
p_track
->
b_ok
=
true
;
p_track
->
b_enable
=
true
;
p_track
->
b_enable
=
true
;
if
(
!
p_track
->
p_es
)
p_track
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
p_track
->
fmt
);
p_track
->
b_codec_need_restart
=
false
;
p_track
->
b_codec_need_restart
=
false
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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