[xiph-commits] r12159 - trunk/vorbis-tools/ogginfo

msmith at svn.xiph.org msmith at svn.xiph.org
Thu Nov 30 04:35:57 PST 2006


Author: msmith
Date: 2006-11-30 04:35:55 -0800 (Thu, 30 Nov 2006)
New Revision: 12159

Modified:
   trunk/vorbis-tools/ogginfo/ogginfo2.c
Log:
Make this work right....


Modified: trunk/vorbis-tools/ogginfo/ogginfo2.c
===================================================================
--- trunk/vorbis-tools/ogginfo/ogginfo2.c	2006-11-30 12:23:37 UTC (rev 12158)
+++ trunk/vorbis-tools/ogginfo/ogginfo2.c	2006-11-30 12:35:55 UTC (rev 12159)
@@ -429,11 +429,31 @@
 		}
 	    }
 	}
+        else {
+            ogg_int64_t framenum;
+            ogg_int64_t iframe,pframe;
+            ogg_int64_t gp = packet.granulepos;
+
+            if(gp > 0) {
+                iframe=gp>>inf->ti.granule_shift;
+                pframe=gp-(iframe<<inf->ti.granule_shift);
+                framenum = iframe+pframe;
+                if(inf->framenum_expected >= 0 && 
+                    inf->framenum_expected != framenum)
+                {
+                    warn(_("Warning: Expected frame %" I64FORMAT 
+                           ", got %" I64FORMAT "\n"), 
+                           inf->framenum_expected, framenum);
+                }
+                inf->framenum_expected = framenum + 1;
+            }
+            else if (inf->framenum_expected >= 0) {
+                inf->framenum_expected++;
+            }
+        }
     }
 
     if(!header) {
-        ogg_int64_t framenum;
-        ogg_int64_t iframe,pframe;
         ogg_int64_t gp = ogg_page_granulepos(page);
         if(gp > 0) {
             if(gp < inf->lastgranulepos)
@@ -445,20 +465,6 @@
         if(inf->firstgranulepos < 0) { /* Not set yet */
         }
         inf->bytes += page->header_len + page->body_len;
-
-        if(gp > 0) {
-            iframe=gp>>inf->ti.granule_shift;
-            pframe=gp-(iframe<<inf->ti.granule_shift);
-            framenum = iframe+pframe;
-            if(inf->framenum_expected >= 0 && 
-                inf->framenum_expected != framenum)
-            {
-                warn(_("Warning: Expected frame %" I64FORMAT 
-                       ", got %" I64FORMAT "\n"), 
-                       inf->framenum_expected, framenum);
-            }
-            inf->framenum_expected = framenum + 1;
-        }
     }
 }
 



More information about the commits mailing list