mirror of
https://github.com/fmang/opustags.git
synced 2025-07-12 20:15:39 +02:00
ogg: checked the packetno of the OpusTags packet
This commit is contained in:
@ -265,7 +265,7 @@ void ogg::Encoder::write_tags(int streamno, const Tags &tags)
|
||||
op.b_o_s = 0;
|
||||
op.e_o_s = 0;
|
||||
op.granulepos = 0;
|
||||
op.packetno = 1; // TODO ensure it's not 2
|
||||
op.packetno = 1; // checked on a file from ffmpeg
|
||||
|
||||
std::string data = render_opustags(tags);
|
||||
op.bytes = data.size();
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("decoding a single-stream file", "[ogg]")
|
||||
TEST_CASE("decoding a single-stream Ogg Opus file", "[ogg]")
|
||||
{
|
||||
std::ifstream src("../tests/samples/mystery.ogg");
|
||||
ogg::Decoder dec(src);
|
||||
@ -29,8 +29,18 @@ TEST_CASE("decoding garbage", "[ogg]")
|
||||
REQUIRE_THROWS(dec.read_page());
|
||||
}
|
||||
|
||||
TEST_CASE("decoding an Ogg Vorbis file", "[ogg]")
|
||||
{
|
||||
std::ifstream src("../tests/samples/beep.ogg");
|
||||
ogg::Decoder dec(src);
|
||||
|
||||
std::shared_ptr<ogg::Stream> s = dec.read_page();
|
||||
REQUIRE(s != nullptr);
|
||||
REQUIRE(s->state == ogg::RAW_READY);
|
||||
REQUIRE(s->type == ogg::UNKNOWN_STREAM);
|
||||
}
|
||||
|
||||
// TODO decoding a multi-stream file
|
||||
// TODO decoding a vorbis ogg stream
|
||||
|
||||
// Encoding is trickier, and might as well be done in actions_test.cc, given
|
||||
// opustags::edit_tags covers all of Encoder's regular code.
|
||||
|
BIN
tests/samples/beep.ogg
Normal file
BIN
tests/samples/beep.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user