diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index ed6914ffaa..7bfdc86fda 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -2144,6 +2144,10 @@ qtdemux_parse_uuid (GstQTDemux * qtdemux, const guint8 * buffer, gint length) 0x9C, 0x71, 0x99, 0x94, 0x91, 0xE3, 0xAF, 0xAC }; + static guint8 playready_uuid[] = { + 0xd0, 0x8a, 0x4f, 0x18, 0x10, 0xf3, 0x4a, 0x82, + 0xb6, 0xc8, 0x32, 0xd8, 0xab, 0xa1, 0x83, 0xd3 + }; guint offset; /* counts as header data */ @@ -2167,8 +2171,27 @@ qtdemux_parse_uuid (GstQTDemux * qtdemux, const guint8 * buffer, gint length) qtdemux_handle_xmp_taglist (qtdemux, taglist); + } else if (memcmp (buffer + offset, playready_uuid, 16) == 0) { + int len; + const gunichar2 *s_utf16; + char *contents; + + len = GST_READ_UINT16_LE (buffer + offset + 0x30); + s_utf16 = (const gunichar2 *) (buffer + offset + 0x32); + contents = g_utf16_to_utf8 (s_utf16, len / 2, NULL, NULL, NULL); + GST_ERROR_OBJECT (qtdemux, "contents: %s", contents); + + g_free (contents); + + GST_ELEMENT_ERROR (qtdemux, STREAM, DECRYPT, + (_("Cannot play stream because it is encrypted with PlayReady DRM.")), + (NULL)); } else { - GST_DEBUG_OBJECT (qtdemux, "Ignoring unknown uuid"); + GST_DEBUG_OBJECT (qtdemux, "Ignoring unknown uuid: %08x-%08x-%08x-%08x", + GST_READ_UINT32_LE (buffer + offset), + GST_READ_UINT32_LE (buffer + offset + 4), + GST_READ_UINT32_LE (buffer + offset + 8), + GST_READ_UINT32_LE (buffer + offset + 12)); } } @@ -5311,6 +5334,11 @@ qtdemux_parse_node (GstQTDemux * qtdemux, GNode * node, const guint8 * buffer, qtdemux_parse_container (qtdemux, node, buffer + 0x34, end); break; } + case FOURCC_uuid: + { + qtdemux_parse_uuid (qtdemux, buffer, end - buffer); + break; + } default: if (!strcmp (type->name, "unknown")) GST_MEMDUMP ("Unknown tag", buffer + 4, end - buffer - 4);