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
a4db08e9
Commit
a4db08e9
authored
Jun 11, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mux: mp4: try not to set artitrary length on boundaries
parent
429057f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
modules/mux/mp4.c
modules/mux/mp4.c
+32
-3
No files found.
modules/mux/mp4.c
View file @
a4db08e9
...
...
@@ -473,9 +473,38 @@ static int Mux(sout_mux_t *p_mux)
/* Fix length of the sample */
if
(
block_FifoCount
(
p_input
->
p_fifo
)
>
0
)
{
block_t
*
p_next
=
block_FifoShow
(
p_input
->
p_fifo
);
int64_t
i_diff
=
p_next
->
i_dts
-
p_data
->
i_dts
;
if
(
i_diff
<
CLOCK_FREQ
)
/* protection */
p_data
->
i_length
=
i_diff
;
if
(
p_next
->
i_flags
&
BLOCK_FLAG_DISCONTINUITY
)
{
/* we have no way to know real length except by decoding */
if
(
p_stream
->
fmt
.
i_cat
==
VIDEO_ES
)
{
p_data
->
i_length
=
CLOCK_FREQ
*
p_stream
->
fmt
.
video
.
i_frame_rate_base
/
p_stream
->
fmt
.
video
.
i_frame_rate
;
msg_Dbg
(
p_mux
,
"video track %d fixup to %"
PRId64
" for sample %u"
,
p_stream
->
i_track_id
,
p_data
->
i_length
,
p_stream
->
i_entry_count
);
}
else
if
(
p_stream
->
fmt
.
i_cat
==
AUDIO_ES
&&
p_stream
->
fmt
.
audio
.
i_rate
&&
p_data
->
i_nb_samples
)
{
p_data
->
i_length
=
CLOCK_FREQ
*
p_data
->
i_nb_samples
/
p_stream
->
fmt
.
audio
.
i_rate
;
msg_Dbg
(
p_mux
,
"audio track %d fixup to %"
PRId64
" for sample %u"
,
p_stream
->
i_track_id
,
p_data
->
i_length
,
p_stream
->
i_entry_count
);
}
else
if
(
p_data
->
i_length
<=
0
)
{
msg_Warn
(
p_mux
,
"unknown length for track %d sample %u"
,
p_stream
->
i_track_id
,
p_stream
->
i_entry_count
);
p_data
->
i_length
=
1
;
}
}
else
{
int64_t
i_diff
=
p_next
->
i_dts
-
p_data
->
i_dts
;
if
(
i_diff
<
CLOCK_FREQ
)
/* protection */
p_data
->
i_length
=
i_diff
;
}
}
if
(
p_data
->
i_length
<=
0
)
{
msg_Warn
(
p_mux
,
"i_length <= 0"
);
...
...
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