From 3d894ebe84e8b365b783b31ef35d872de068c53b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 24 Nov 2008 19:18:59 +0000 Subject: [PATCH] ext/ogg/gstoggmux.*: If we're muxing a dirac stream, flush the page after every picture. Original commit message from CVS: * ext/ogg/gstoggmux.c: * ext/ogg/gstoggmux.h: If we're muxing a dirac stream, flush the page after every picture. --- ChangeLog | 6 ++++++ ext/ogg/gstoggmux.c | 5 ++++- ext/ogg/gstoggmux.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b33e76412d..5274980954 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-24 David Schleef + + * ext/ogg/gstoggmux.c: + * ext/ogg/gstoggmux.h: + If we're muxing a dirac stream, flush the page after every picture. + 2008-11-24 Stefan Kost * gst-libs/gst/audio/gstbaseaudiosink.c: diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 21ea697e55..46ace8794b 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -876,6 +876,7 @@ gst_ogg_mux_get_headers (GstOggPad * pad) res = g_list_append (res, pad->buffer); pad->buffer = pad->next_buffer; pad->next_buffer = NULL; + pad->always_flush_page = TRUE; } else { GST_LOG_OBJECT (thepad, "caps don't have streamheader"); } @@ -1040,9 +1041,11 @@ gst_ogg_mux_send_headers (GstOggMux * mux) 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); + pad->always_flush_page = TRUE; } 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 { hbufs = g_list_append (hbufs, hbuf); } @@ -1279,7 +1282,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPad * best) tmpbuf = NULL; /* we flush when we see a new keyframe */ - force_flush = (pad->prev_delta && !delta_unit); + force_flush = (pad->prev_delta && !delta_unit) || pad->always_flush_page; if (duration != -1) { pad->duration += duration; /* if page duration exceeds max, flush page */ diff --git a/ext/ogg/gstoggmux.h b/ext/ogg/gstoggmux.h index 4d1d233c9d..fc0944f21a 100644 --- a/ext/ogg/gstoggmux.h +++ b/ext/ogg/gstoggmux.h @@ -79,6 +79,8 @@ typedef struct gboolean prev_delta; /* was the previous buffer a delta frame */ GstPadEventFunction collect_event; + + gboolean always_flush_page; } GstOggPad;