From fd8434fc7450dc3bdc057d2d89a875be9b683181 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 17 Aug 2011 18:38:39 +0100 Subject: [PATCH] oggmux: use oggstream to decide which BOS packets to place first Ogg recommends video BOS packets to be first. Use the "is_video" flag in oggstream to select those, rather than check for known mime types. https://bugzilla.gnome.org/show_bug.cgi?id=656775 --- ext/ogg/gstoggmux.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 0ac8442598..d24e4bb282 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -1232,25 +1232,23 @@ gst_ogg_mux_send_headers (GstOggMux * mux) GST_LOG_OBJECT (mux, "swapped out page with mime type %s", gst_structure_get_name (structure)); - /* quick hack: put Theora, VP8 and Dirac video pages at the front. + /* quick hack: put video pages at the front. * Ideally, we would have a settable enum for which Ogg * profile we work with, and order based on that. * (FIXME: if there is more than one video stream, shouldn't we only put * one's BOS into the first page, followed by an audio stream's BOS, and * only then followed by the remaining video and audio streams?) */ - if (gst_structure_has_name (structure, "video/x-theora")) { - GST_DEBUG_OBJECT (thepad, "putting %s page at the front", "Theora"); - hbufs = g_list_prepend (hbufs, hbuf); - } else if (gst_structure_has_name (structure, "video/x-dirac")) { - GST_DEBUG_OBJECT (thepad, "putting %s page at the front", "Dirac"); - hbufs = g_list_prepend (hbufs, hbuf); - pad->always_flush_page = TRUE; - } else if (gst_structure_has_name (structure, "video/x-vp8")) { - GST_DEBUG_OBJECT (thepad, "putting %s page at the front", "VP8"); + if (pad->map.is_video) { + GST_DEBUG_OBJECT (thepad, "putting %s page at the front", + gst_structure_get_name (structure)); hbufs = g_list_prepend (hbufs, hbuf); } else { hbufs = g_list_append (hbufs, hbuf); } + + if (gst_structure_has_name (structure, "video/x-dirac")) { + pad->always_flush_page = TRUE; + } gst_caps_unref (caps); }