ext/ogg/gstoggmux.c: Oggmux sucks.
authorMichael Smith <msmith@xiph.org>
Mon, 3 Apr 2006 12:55:18 +0000 (12:55 +0000)
committerMichael Smith <msmith@xiph.org>
Mon, 3 Apr 2006 12:55:18 +0000 (12:55 +0000)
Original commit message from CVS:
* ext/ogg/gstoggmux.c: (gst_ogg_mux_queue_pads):
Oggmux sucks.
Make it suck slightly less by writing out the final page.
Still can't encode a vorbis-in-ogg file correctly, though.

ChangeLog
ext/ogg/gstoggmux.c

index 70dc8b4..d39971f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-03  Michael Smith  <msmith@fluendo.com>
+
+       * ext/ogg/gstoggmux.c: (gst_ogg_mux_queue_pads):
+         Oggmux sucks.
+         Make it suck slightly less by writing out the final page.
+         Still can't encode a vorbis-in-ogg file correctly, though.
+
 2006-04-03  Andy Wingo  <wingo@pobox.com>
 
        * ext/theora/theoraparse.c (theora_parse_drain_queue): Um, remove
index 0787043..b68d597 100644 (file)
@@ -768,7 +768,23 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux)
         }
       } else {
         GST_DEBUG_OBJECT (data->pad, "EOS on pad");
-        pad->eos = TRUE;
+        if (!pad->eos) {
+          ogg_page page;
+          GstFlowReturn ret;
+
+          /* Just gone to EOS. Flush existing page(s) */
+          pad->eos = TRUE;
+
+          while (ogg_stream_flush (&pad->stream, &page)) {
+            /* Place page into the per-pad queue */
+            ret = gst_ogg_mux_pad_queue_page (ogg_mux, pad, &page,
+                pad->first_delta);
+            /* increment the page number counter */
+            pad->pageno++;
+            /* mark other pages as delta */
+            pad->first_delta = TRUE;
+          }
+        }
       }
 
       pad->buffer = buf;