Commit 1badb3b5 authored by Max Kellermann's avatar Max Kellermann

encoder/opus: initialize the "granulepos" packet attribute

parent 038d216f
...@@ -63,6 +63,8 @@ struct opus_encoder { ...@@ -63,6 +63,8 @@ struct opus_encoder {
OggStream stream; OggStream stream;
ogg_int64_t packetno; ogg_int64_t packetno;
ogg_int64_t granulepos;
}; };
gcc_const gcc_const
...@@ -235,12 +237,14 @@ opus_encoder_do_encode(struct opus_encoder *encoder, bool eos, ...@@ -235,12 +237,14 @@ opus_encoder_do_encode(struct opus_encoder *encoder, bool eos,
return false; return false;
} }
encoder->granulepos += encoder->buffer_frames;
ogg_packet packet; ogg_packet packet;
packet.packet = encoder->buffer2; packet.packet = encoder->buffer2;
packet.bytes = result; packet.bytes = result;
packet.b_o_s = false; packet.b_o_s = false;
packet.e_o_s = eos; packet.e_o_s = eos;
packet.granulepos = 0; // TODO packet.granulepos = encoder->granulepos;
packet.packetno = encoder->packetno++; packet.packetno = encoder->packetno++;
encoder->stream.PacketIn(packet); encoder->stream.PacketIn(packet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment