mirror of
https://github.com/fmang/opustags.git
synced 2025-07-12 04:05:09 +02:00
ogg: parse magic number
This commit is contained in:
11
src/ogg.cc
11
src/ogg.cc
@ -2,6 +2,7 @@
|
||||
|
||||
#include <stdexcept>
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
@ -65,9 +66,13 @@ void ogg::Stream::handle_packet(const ogg_packet &op)
|
||||
|
||||
void ogg::Stream::parse_header(const ogg_packet &op)
|
||||
{
|
||||
// TODO
|
||||
// set type
|
||||
// set state
|
||||
if (op.bytes >= 8 && memcmp(op.packet, "OpusTags", 8) == 0) {
|
||||
type = OPUS_STREAM;
|
||||
state = HEADER_READY;
|
||||
} else {
|
||||
type = UNKNOWN_STREAM;
|
||||
state = RAW_READY;
|
||||
}
|
||||
}
|
||||
|
||||
void ogg::Stream::parse_tags(const ogg_packet &op)
|
||||
|
Reference in New Issue
Block a user