[vorbis-dev] OggMux, a simple ogg file multiplexer

olivier at infolibre.org olivier at infolibre.org
Thu Nov 1 14:12:52 PST 2001



On Thu, Nov 01, 2001 at 09:50:30PM +0100, I wrote:
> It has one major bug: if the playing logical stream is part of an 
> interlaced file the pcmlenght is garbage, and can have unexpexted
> results (still better than now). A quick way to fix it would be to
> disable pcmlenght/seeking if such a file is detected.

Actually, the bigger problem is of course to find a good way to
determine if we are reading an interlaced file. The above patch only
try to find it out by checking if stream boundaries found by
_bisect_forward_serialno() does point to a valid b_o_s .

Probably it would be best to find a way to have an idea of the
interlaced nature of the file before we try _bisect_forward_serialno(),
and use another function to guess stream boundaries if it doesn't
seem plain chained bitstream. We could then get accurate values for
pcmlenghts, and be able to play/seek the streams as if it was a chained
file !

However I don't see any way to do it predictably, other than "guessing" :(

BTW, the above patch has a small sort-of bug fixed by this: (apply after)
--- vorbisfile.c        Thu Nov  1 22:56:07 2001
+++ vorbisfile-fix.c    Thu Nov  1 22:56:52 2001
@@ -502,8 +502,13 @@

     if(vf->ready_state>=OPENED){
       if(!readp)return(0);
-      if(_get_next_page(vf,&og,-1)<0)return(OV_EOF); /* eof.
+      while(1) {
+        if(_get_next_page(vf,&og,-1)<0)return(OV_EOF); /* eof.
                                                        leave unitialized */
+       printf("current_serialno: %d\n", vf->current_serialno);
+       if((!vf->current_serialno) ||
+                (ogg_page_serialno(&og) == vf->current_serialno)) break;
+      }
       /* bitrate tracking; add the header's bytes here, the body bytes
         are done by packet above */
       vf->bittrack+=og.header_len*8;

Olivier

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list