Tests: skip mp4 if ffmpeg does not support lavfi format.
diff --git a/mp4.t b/mp4.t
index c6096cb..50f9db0 100644
--- a/mp4.t
+++ b/mp4.t
@@ -25,7 +25,7 @@
my $t = Test::Nginx->new()->has(qw/http mp4/)->has_daemon('ffprobe')
->has_daemon('ffmpeg')
- ->plan(14)->write_file_expand('nginx.conf', <<'EOF');
+ ->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -49,6 +49,8 @@
EOF
+plan(skip_all => 'no lavfi')
+ unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
system('ffmpeg -loglevel quiet -y '
. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
. '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 '
@@ -56,7 +58,7 @@
. "${\($t->testdir())}/test.mp4") == 0
or die "Can't create mp4 file: $!";
-$t->run();
+$t->run()->plan(14);
###############################################################################
diff --git a/range_mp4.t b/range_mp4.t
index 5275f79..b7cb7bd 100644
--- a/range_mp4.t
+++ b/range_mp4.t
@@ -22,7 +22,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http mp4/)->has_daemon('ffmpeg')->plan(13);
+my $t = Test::Nginx->new()->has(qw/http mp4/)->has_daemon('ffmpeg');
$t->write_file_expand('nginx.conf', <<'EOF');
@@ -47,12 +47,14 @@
EOF
+plan(skip_all => 'no lavfi')
+ unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
system('ffmpeg -loglevel quiet -y '
. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
. "-pix_fmt yuv420p -c:v libx264 ${\($t->testdir())}/test.mp4") == 0
or die "Can't create mp4 file: $!";
-$t->run();
+$t->run()->plan(13);
###############################################################################