summaryrefslogtreecommitdiff
path: root/gst/asfmux
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-06-27 11:23:19 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2012-06-27 11:23:19 +0200
commitba87a4524fe95eea38160c90dd7f0229367cfe2a (patch)
tree6a3c865cfa09dff784f6a8d6534fb3987c2b24d7 /gst/asfmux
parentc0cd1c43aba7a010030cf76594801d9ce39df3bb (diff)
downloadgstreamer-plugins-bad-ba87a4524fe95eea38160c90dd7f0229367cfe2a.tar.gz
fix x-wmv format string
Diffstat (limited to 'gst/asfmux')
-rw-r--r--gst/asfmux/gstasfmux.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gst/asfmux/gstasfmux.c b/gst/asfmux/gstasfmux.c
index 78b17dea7..c7d674397 100644
--- a/gst/asfmux/gstasfmux.c
+++ b/gst/asfmux/gstasfmux.c
@@ -2200,27 +2200,25 @@ gst_asf_mux_video_set_caps (GstPad * pad, GstCaps * caps)
}
if (strcmp (caps_name, "video/x-wmv") == 0) {
- guint32 fourcc;
+ gint wmvversion;
+ const gchar *fstr;
videopad->vidinfo.bit_cnt = 24;
- /* in case we have a fourcc, we use it */
- if (gst_structure_get_uint (structure, "format", &fourcc)) {
- videopad->vidinfo.compression = fourcc;
- } else {
- gint version;
- if (!gst_structure_get_int (structure, "wmvversion", &version))
- goto refuse_caps;
- if (version == 2) {
+ /* in case we have a format, we use it */
+ fstr = gst_structure_get_string (structure, "format");
+ if (fstr && strlen (fstr) == 4) {
+ videopad->vidinfo.compression = GST_STR_FOURCC (fstr);
+ } else if (gst_structure_get_int (structure, "wmvversion", &wmvversion)) {
+ if (wmvversion == 2) {
videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '2');
- } else if (version == 1) {
+ } else if (wmvversion == 1) {
videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '1');
- } else if (version == 3) {
+ } else if (wmvversion == 3) {
videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '3');
- } else {
- goto refuse_caps;
}
- }
+ } else
+ goto refuse_caps;
} else {
goto refuse_caps;
}