[xiph-cvs] r6146 - trunk/speex/src

jm at xiph.org jm at xiph.org
Sat Mar 20 22:22:48 PST 2004



Author: jm
Date: 2004-03-21 01:22:48 -0500 (Sun, 21 Mar 2004)
New Revision: 6146

Modified:
   trunk/speex/src/speexenc.c
Log:
Flush page after the header (in order to follow the Ogg spec)

<p>Modified: trunk/speex/src/speexenc.c
===================================================================
--- trunk/speex/src/speexenc.c	2004-03-21 05:26:04 UTC (rev 6145)
+++ trunk/speex/src/speexenc.c	2004-03-21 06:22:48 UTC (rev 6146)
@@ -562,7 +562,7 @@
    }
 
 
-   /*Write header (format will change)*/
+   /*Write header*/
    {
 
       op.packet = (unsigned char *)speex_header_to_packet(&header, (int*)&(op.bytes));
@@ -573,6 +573,19 @@
       ogg_stream_packetin(&os, &op);
       free(op.packet);
 
+      while((result = ogg_stream_flush(&os, &og)))
+      {
+         if(!result) break;
+         ret = oe_write_page(&og, fout);
+         if(ret != og.header_len + og.body_len)
+         {
+            fprintf (stderr,"Error: failed writing header to output stream\n");
+            exit(1);
+         }
+         else
+            bytes_written += ret;
+      }
+
       op.packet = (unsigned char *)comments;
       op.bytes = comments_length;
       op.b_o_s = 0;

--- >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 'cvs-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 commits mailing list