summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-12-13 14:12:52 +0100
committerJosep Torra <n770galaxy@gmail.com>2013-03-05 11:05:50 +0100
commit14bea4ee6dd3422e4abd94ea6df7b230456f9ad7 (patch)
tree1bb02dc1c5538a9f9094d2aacd8547eb5ce9f16f
parente41a83878acf3a02a531e0cbe585bd6efa2e95ba (diff)
downloadgstreamer-plugins-bad-14bea4ee6dd3422e4abd94ea6df7b230456f9ad7.tar.gz
h264parse: use upstream width/height when given
The upstream width and height should override the dimension detected in the file. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=683142
-rw-r--r--gst/videoparsers/gsth264parse.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 8c9d6c8cb..2ee6b7fda 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1107,12 +1107,24 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
if (G_UNLIKELY (modified)) {
gint fps_num = h264parse->fps_num;
gint fps_den = h264parse->fps_den;
+ gint width, height;
GstClockTime latency;
caps = gst_caps_copy (sink_caps);
- /* sps should give this */
- gst_caps_set_simple (caps, "width", G_TYPE_INT, sps->width,
- "height", G_TYPE_INT, sps->height, NULL);
+
+ /* sps should give this but upstream overrides */
+ if (s && gst_structure_has_field (s, "width"))
+ gst_structure_get_int (s, "width", &width);
+ else
+ width = sps->width;
+
+ if (s && gst_structure_has_field (s, "height"))
+ gst_structure_get_int (s, "height", &height);
+ else
+ height = sps->height;
+
+ gst_caps_set_simple (caps, "width", G_TYPE_INT, width,
+ "height", G_TYPE_INT, height, NULL);
/* upstream overrides */
if (s && gst_structure_has_field (s, "framerate"))