Skip to content

Commit 06f0bc4

Browse files
committed
store byte position for each box to be able to locate data
1 parent 45d9c03 commit 06f0bc4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/box.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ struct Box
1414
{
1515
uint32_t fourcc;
1616
uint64_t size;
17+
uint64_t position;
1718
std::vector<Box> children;
1819
std::vector<Symbol> syms;
1920
};

src/box_reader_impl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct BoxReader : IReader
2323
{
2424
BoxReader subReader;
2525
subReader.spec = spec;
26+
subReader.myBox.position = myBox.position + br.m_pos / 8;
2627
subReader.myBox.size = br.u(32);
2728
subReader.myBox.fourcc = br.u(32);
2829
unsigned boxHeaderSize = 8;
@@ -49,7 +50,7 @@ struct BoxReader : IReader
4950

5051
BitReader br;
5152

52-
Box myBox;
53+
Box myBox {};
5354
const SpecDesc* spec = nullptr;
5455

5556
private:

0 commit comments

Comments
 (0)