From caf418b6a59c3aa265e23a476c913c82e3a0453a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Tue, 1 Jan 2013 16:23:48 +0100 Subject: [PATCH] read all the packets --- opustags.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opustags.c b/opustags.c index b896186..54a49d4 100644 --- a/opustags.c +++ b/opustags.c @@ -151,13 +151,14 @@ int main(int argc, char **argv){ error = "ogg_stream_pagein: invalid page"; break; } - if(ogg_stream_packetout(&os, &op) == 1){ + // Read all the packets. + while(ogg_stream_packetout(&os, &op) == 1){ packet_count++; if(packet_count == 1){ // Identification header if(strncmp((char*) op.packet, "OpusHead", 8) != 0) error = "opustags: invalid identification header"; } - if(packet_count == 2){ // Comment header + else if(packet_count == 2){ // Comment header if(parse_tags((char*) op.packet, op.bytes, &tags) == -1) error = "opustags: invalid comment header"; // DEBUG