From 1c6ee3fba47fb8efb8c312239cc9cb7673371351 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 9 Jan 2014 18:25:04 +0000 Subject: [PATCH] matroskamux: write subtitle codec ID and data at start when known This avoids issues with writing dummy data first, then having to come back and write correct data later. Doing so prevents the muxed stream from being actually streamable. https://bugzilla.gnome.org/show_bug.cgi?id=712134 --- gst/matroska/matroska-mux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index b79edb19d0..e594fbc6fc 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -2378,7 +2378,13 @@ gst_matroska_mux_track_header (GstMatroskaMux * mux, case GST_MATROSKA_TRACK_TYPE_SUBTITLE:{ gpointer buf; + /* If codec_id and codec data are already known, we can write + them now, as for audio/video */ + if (context->codec_id && context->codec_priv) + break; + context->pos = ebml->pos; + /* CodecID is mandatory ... */ gst_ebml_write_ascii (ebml, GST_MATROSKA_ID_CODECID, "S_SUB_UNKNOWN"); /* reserve space */