From cc38f1947775c65c6e53d9854946c926188e14e5 Mon Sep 17 00:00:00 2001 From: Oswald Auguste de Bruin Date: Mon, 9 Sep 2013 15:38:35 +0200 Subject: [PATCH] Fixed Ogg problems --- lib/ogg.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ogg.cpp b/lib/ogg.cpp index 0592d6e9..37814e52 100644 --- a/lib/ogg.cpp +++ b/lib/ogg.cpp @@ -227,9 +227,11 @@ namespace OGG{ STerrMSG(); return false; } - if (layout[i] != 0){ + if (layout[i] >= 0){//fix somewhere here table[place] = layout[i]; - place++; + if (place<255){//last segment does not need a closing 0 + place++; + } } } setPageSegments(place); @@ -472,7 +474,7 @@ namespace OGG{ void Page::readDTSCVector(std::vector DTSCVec, unsigned int serial, unsigned int sequence){ clear(); setVersion(); - if (DTSCVec[0]["OggCont"]){ + if (DTSCVec[0]["OggCont"] || DTSCVec[0]["granule"].asInt() == -1){//if it is a continue page, also for granule=0xFFFFFFFF setHeaderType(1);//headertype 1 = Continue Page }else if (DTSCVec[0]["OggEOS"]){ setHeaderType(4);//headertype 4 = end of stream