Skip to content

Commit

Permalink
Merge pull request #12 from goruklu/mse-new-backend
Browse files Browse the repository at this point in the history
bugfix: prevent initdatabuffer being overwritten when multiple keysytems are present
  • Loading branch information
albertd committed Oct 8, 2015
2 parents be28517 + b2c5770 commit 68cccda
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,10 @@ static gboolean webkitMediaPlayReadyDecryptSinkEventHandler(GstBaseTransform* tr
case GST_EVENT_PROTECTION: {
const gchar* systemId;
const gchar* origin;
GstBuffer* initdatabuffer;

GST_INFO_OBJECT(self, "received protection event");
gst_event_parse_protection(event, &systemId, &self->initDataBuffer, &origin);
gst_event_parse_protection(event, &systemId, &initdatabuffer, &origin);
GST_DEBUG_OBJECT(self, "systemId: %s", systemId);
if (!g_str_equal(systemId, PLAYREADY_PROTECTION_SYSTEM_ID)
|| !g_str_has_prefix(origin, "smooth-streaming")) {
Expand All @@ -368,6 +369,7 @@ static gboolean webkitMediaPlayReadyDecryptSinkEventHandler(GstBaseTransform* tr
// Keep the event ref around so that the parsed event data
// remains valid until the drm-key-need message has been sent.
self->protectionEvent = event;
self->initDataBuffer = initdatabuffer;
g_timeout_add(0, requestKey, self);

result = TRUE;
Expand Down

0 comments on commit 68cccda

Please sign in to comment.