diff options
author | Arnaud Vrac <avrac@freebox.fr> | 2013-08-30 22:42:00 +0200 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2016-04-16 22:02:52 +1000 |
commit | 1c65828968f4b0c7c344bf46606af3404698d444 (patch) | |
tree | 6451a7c3215fba902c7b9eed6f88d03a3d39dbef | |
parent | debe290d0ef23d8f7c8f8a6176c1fb08ba70dd5f (diff) | |
download | gstreamer-plugins-good-1c65828968f4b0c7c344bf46606af3404698d444.tar.gz |
matroskademux: send custom event with DVD subtitles frame size
The event is named application/x-gst-dvd-frame-size instead of
application/x-gst-dvd, otherwise the clut event might be overwritten by
this one since both are sticky.
https://bugzilla.gnome.org/show_bug.cgi?id=685282
-rw-r--r-- | gst/matroska/matroska-demux.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 00b65f7d2..6005846eb 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -50,6 +50,7 @@ #endif #include <math.h> +#include <stdio.h> #include <string.h> #include <glib/gprintf.h> @@ -2667,7 +2668,7 @@ gst_matroska_demux_push_dvd_clut_change_event (GstMatroskaDemux * demux, /* make sure we have terminating 0 */ buf = g_strndup (stream->codec_priv, stream->codec_priv_size); - /* just locate and parse palette part */ + /* locate and parse palette part */ start = strstr (buf, "palette:"); if (start) { gint i; @@ -2714,6 +2715,28 @@ gst_matroska_demux_push_dvd_clut_change_event (GstMatroskaDemux * demux, gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM_STICKY, s)); } } + + /* locate and parse frame size */ + start = strstr (buf, "size:"); + if (start) { + guint width, height; + + start += 5; + while (g_ascii_isspace (*start)) + start++; + + if (sscanf (start, "%ux%u", &width, &height) == 2) { + GstStructure *s; + + s = gst_structure_new ("application/x-gst-dvd-frame-size", + "event", G_TYPE_STRING, "dvd-set-frame-size", + "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL); + + gst_pad_push_event (stream->pad, + gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM_STICKY, s)); + } + } + g_free (buf); } |