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
e6608519
Commit
e6608519
authored
Aug 24, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp4 mux: use CLOCK_FREQ
parent
0fef7e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
modules/mux/mp4.c
modules/mux/mp4.c
+11
-14
No files found.
modules/mux/mp4.c
View file @
e6608519
...
...
@@ -457,7 +457,7 @@ static int Mux(sout_mux_t *p_mux)
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
<
INT64_C
(
1000000
)
)
/* protection */
if
(
i_diff
<
CLOCK_FREQ
)
/* protection */
p_data
->
i_length
=
i_diff
;
}
if
(
p_data
->
i_length
<=
0
)
{
...
...
@@ -1226,10 +1226,9 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
mp4_stream_t
*
p_stream
=
p_sys
->
pp_streams
[
i_trak
];
i_movie_duration
=
__MAX
(
i_movie_duration
,
p_stream
->
i_duration
);
}
msg_Dbg
(
p_mux
,
"movie duration %ds"
,
(
uint32_t
)(
i_movie_duration
/
(
mtime_t
)
1000000
));
msg_Dbg
(
p_mux
,
"movie duration %"
PRId64
"s"
,
i_movie_duration
/
CLOCK_FREQ
);
i_movie_duration
=
i_movie_duration
*
i_movie_timescale
/
1000000
;
i_movie_duration
=
i_movie_duration
*
i_movie_timescale
/
CLOCK_FREQ
;
/* *** add /moov/mvhd *** */
if
(
!
p_sys
->
b_64_ext
)
{
...
...
@@ -1285,8 +1284,7 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
bo_add_32be
(
tkhd
,
p_stream
->
i_track_id
);
bo_add_32be
(
tkhd
,
0
);
// reserved 0
bo_add_32be
(
tkhd
,
p_stream
->
i_duration
*
(
int64_t
)
i_movie_timescale
/
(
mtime_t
)
1000000
);
// duration
(
int64_t
)
i_movie_timescale
/
CLOCK_FREQ
);
// duration
}
else
{
if
(
p_sys
->
b_mov
)
tkhd
=
box_full_new
(
"tkhd"
,
1
,
0x0f
);
...
...
@@ -1298,8 +1296,7 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
bo_add_32be
(
tkhd
,
p_stream
->
i_track_id
);
bo_add_32be
(
tkhd
,
0
);
// reserved 0
bo_add_64be
(
tkhd
,
p_stream
->
i_duration
*
(
int64_t
)
i_movie_timescale
/
(
mtime_t
)
1000000
);
// duration
(
int64_t
)
i_movie_timescale
/
CLOCK_FREQ
);
// duration
}
for
(
int
i
=
0
;
i
<
2
;
i
++
)
...
...
@@ -1356,11 +1353,11 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
if
(
p_sys
->
b_64_ext
)
{
bo_add_64be
(
elst
,
(
p_stream
->
i_dts_start
-
p_sys
->
i_dts_start
)
*
i_movie_timescale
/
INT64_C
(
1000000
)
);
i_movie_timescale
/
CLOCK_FREQ
);
bo_add_64be
(
elst
,
-
1
);
}
else
{
bo_add_32be
(
elst
,
(
p_stream
->
i_dts_start
-
p_sys
->
i_dts_start
)
*
i_movie_timescale
/
INT64_C
(
1000000
)
);
i_movie_timescale
/
CLOCK_FREQ
);
bo_add_32be
(
elst
,
-
1
);
}
bo_add_16be
(
elst
,
1
);
...
...
@@ -1370,11 +1367,11 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
}
if
(
p_sys
->
b_64_ext
)
{
bo_add_64be
(
elst
,
p_stream
->
i_duration
*
i_movie_timescale
/
INT64_C
(
1000000
)
);
i_movie_timescale
/
CLOCK_FREQ
);
bo_add_64be
(
elst
,
0
);
}
else
{
bo_add_32be
(
elst
,
p_stream
->
i_duration
*
i_movie_timescale
/
INT64_C
(
1000000
)
);
i_movie_timescale
/
CLOCK_FREQ
);
bo_add_32be
(
elst
,
0
);
}
bo_add_16be
(
elst
,
1
);
...
...
@@ -1394,14 +1391,14 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
bo_add_32be
(
mdhd
,
i_timestamp
);
// modification time
bo_add_32be
(
mdhd
,
i_timescale
);
// timescale
bo_add_32be
(
mdhd
,
p_stream
->
i_duration
*
(
int64_t
)
i_timescale
/
(
mtime_t
)
1000000
);
// duration
CLOCK_FREQ
);
// duration
}
else
{
mdhd
=
box_full_new
(
"mdhd"
,
1
,
0
);
bo_add_64be
(
mdhd
,
i_timestamp
);
// creation time
bo_add_64be
(
mdhd
,
i_timestamp
);
// modification time
bo_add_32be
(
mdhd
,
i_timescale
);
// timescale
bo_add_64be
(
mdhd
,
p_stream
->
i_duration
*
(
int64_t
)
i_timescale
/
(
mtime_t
)
1000000
);
// duration
CLOCK_FREQ
);
// duration
}
if
(
p_stream
->
fmt
.
psz_language
)
{
...
...
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