summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-12-11 17:33:26 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-12-11 17:33:26 +0000
commite7ae77b8ed52039e9f17c15caaa7da224764fa67 (patch)
tree412004ff3abdff5c442e96e9939dcb88f277f451 /gst
parentbaf6486f6c9682f246207e5adb3a4363e1aad2a1 (diff)
downloadgst-plugins-bad-e7ae77b8ed52039e9f17c15caaa7da224764fa67.tar.gz
gst-plugins-bad-e7ae77b8ed52039e9f17c15caaa7da224764fa67.tar.bz2
gst-plugins-bad-e7ae77b8ed52039e9f17c15caaa7da224764fa67.zip
gst/qtdemux/qtdemux.c: Fix non-working redirects from inetfilm.com (handle 'alis' reference data type as well). Fixes...
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (qtdemux_parse_tree): Fix non-working redirects from inetfilm.com (handle 'alis' reference data type as well). Fixes #378613.
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 77493980..c4ffb99f 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -3134,9 +3134,34 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
rdrf = qtdemux_tree_get_child_by_type (rmda, FOURCC_rdrf);
if (rdrf) {
- ref.location = g_strdup ((gchar *) rdrf->data + 20);
- GST_LOG ("New location: %s", ref.location);
- redirects = g_list_prepend (redirects, g_memdup (&ref, sizeof (ref)));
+ guint32 ref_type;
+ guint8 *ref_data;
+
+ ref_type = GST_READ_UINT32_LE ((guint8 *) rdrf->data + 12);
+ ref_data = (guint8 *) rdrf->data + 20;
+ if (ref_type == GST_MAKE_FOURCC ('a', 'l', 'i', 's')) {
+ guint record_len, record_version, fn_len;
+
+ /* MacOSX alias record, google for alias-layout.txt */
+ record_len = GST_READ_UINT16_BE (ref_data + 4);
+ record_version = GST_READ_UINT16_BE (ref_data + 4 + 2);
+ fn_len = GST_READ_UINT8 (ref_data + 50);
+ if (record_len > 50 && record_version == 2 && fn_len > 0) {
+ ref.location = g_strndup ((gchar *) ref_data + 51, fn_len);
+ }
+ } else if (ref_type == GST_MAKE_FOURCC ('u', 'r', 'l', ' ')) {
+ ref.location = g_strdup ((gchar *) ref_data);
+ } else {
+ GST_DEBUG ("unknown rdrf reference type %" GST_FOURCC_FORMAT,
+ GST_FOURCC_ARGS (ref_type));
+ }
+ if (ref.location != NULL) {
+ GST_INFO ("New location: %s", ref.location);
+ redirects =
+ g_list_prepend (redirects, g_memdup (&ref, sizeof (ref)));
+ } else {
+ GST_WARNING ("Failed to extract redirect location from rdrf atom");
+ }
}
/* look for others */