diff --git a/src/ogg.cc b/src/ogg.cc index cc149ee..074317e 100644 --- a/src/ogg.cc +++ b/src/ogg.cc @@ -57,19 +57,28 @@ void ot::ogg_reader::process_header_packet(const std::function 50; +use Test::More tests => 54; use Digest::MD5; use File::Basename; @@ -311,3 +311,13 @@ U=\xFE END_OUT unlink('out.opus'); + +#################################################################################################### +# Multiple-page tags + +my $big_tags = "DATA=x\n" x 15000; # > 90K, which is over the max page size of 64KiB. +is_deeply(opustags(qw(-S gobble.opus -o out.opus), {in => $big_tags}), ['', '', 0], 'write multi-page header'); +is_deeply(opustags('out.opus'), [$big_tags, '', 0], 'read multi-page header'); +is_deeply(opustags(qw(out.opus -i -D -a), 'encoder=Lavc58.18.100 libopus'), ['', '', 0], 'shrink the header'); +is(md5('out.opus'), '111a483596ac32352fbce4d14d16abd2', 'the result is identical to the original file'); +unlink('out.opus');