Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1d62ee38
Commit
1d62ee38
authored
Nov 10, 2015
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
movenc: Add a unit test for signaling of the track start times
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
bef3b1f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
movenc-test.c
libavformat/movenc-test.c
+51
-0
movenc
tests/ref/fate/movenc
+4
-0
No files found.
libavformat/movenc-test.c
View file @
1d62ee38
...
...
@@ -280,6 +280,23 @@ static void skip_gops(int n)
skip_write
=
0
;
}
static
void
signal_init_ts
(
void
)
{
AVPacket
pkt
;
av_init_packet
(
&
pkt
);
pkt
.
size
=
0
;
pkt
.
data
=
NULL
;
pkt
.
stream_index
=
0
;
pkt
.
dts
=
video_dts
;
pkt
.
pts
=
0
;
av_write_frame
(
ctx
,
&
pkt
);
pkt
.
stream_index
=
1
;
pkt
.
dts
=
pkt
.
pts
=
audio_dts
;
av_write_frame
(
ctx
,
&
pkt
);
}
static
void
finish
(
void
)
{
av_write_trailer
(
ctx
);
...
...
@@ -572,6 +589,40 @@ int main(int argc, char **argv)
finish
();
// Test discontinously written fragments with b-frames and audio preroll,
// properly signaled.
av_dict_set
(
&
opts
,
"movflags"
,
"frag_custom+delay_moov+dash"
,
0
);
init
(
1
,
1
);
mux_gops
(
1
);
init_out
(
"delay-moov-elst-signal-init"
);
av_write_frame
(
ctx
,
NULL
);
// Output the moov
close_out
();
memcpy
(
header
,
hash
,
HASH_SIZE
);
av_write_frame
(
ctx
,
NULL
);
// Output the first fragment
init_out
(
"delay-moov-elst-signal-second-frag"
);
mux_gops
(
1
);
av_write_frame
(
ctx
,
NULL
);
// Output the second fragment
close_out
();
memcpy
(
content
,
hash
,
HASH_SIZE
);
finish
();
av_dict_set
(
&
opts
,
"movflags"
,
"frag_custom+delay_moov+dash+frag_discont"
,
0
);
av_dict_set
(
&
opts
,
"fragment_index"
,
"2"
,
0
);
init
(
1
,
1
);
signal_init_ts
();
skip_gops
(
1
);
mux_gops
(
1
);
// Write the second fragment
init_out
(
"delay-moov-elst-signal-init-discont"
);
av_write_frame
(
ctx
,
NULL
);
// Output the moov
close_out
();
check
(
!
memcmp
(
hash
,
header
,
HASH_SIZE
),
"discontinuously written header differs"
);
init_out
(
"delay-moov-elst-signal-second-frag-discont"
);
av_write_frame
(
ctx
,
NULL
);
// Output the second fragment
close_out
();
check
(
!
memcmp
(
hash
,
content
,
HASH_SIZE
),
"discontinuously written fragment differs"
);
finish
();
// Test VFR content, with sidx atoms (which declare the pts duration
// of a fragment, forcing overriding the start pts of the next one).
// Here, the fragment duration in pts is significantly different from
...
...
tests/ref/fate/movenc
View file @
1d62ee38
...
...
@@ -20,5 +20,9 @@ f12baf7c4269695817337192c7069328 996 delay-moov-content
41afdc44b0e376fae49a730afe0c53c2 704 delay-moov-elst-second-frag
93d5d944d10570857b726dd1c482bc03 1207 delay-moov-elst-init-discont
41afdc44b0e376fae49a730afe0c53c2 704 delay-moov-elst-second-frag-discont
bf648056bf98cf98b0fbd1334d788423 1243 delay-moov-elst-signal-init
13b8487a4f004ec9f1db543aee1e5e18 704 delay-moov-elst-signal-second-frag
bf648056bf98cf98b0fbd1334d788423 1243 delay-moov-elst-signal-init-discont
13b8487a4f004ec9f1db543aee1e5e18 704 delay-moov-elst-signal-second-frag-discont
4407220c69fb6d96fd3f4daea05140c3 3647 vfr
4407220c69fb6d96fd3f4daea05140c3 3647 vfr-noduration
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