Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions InterfacePlayerRDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5051,16 +5051,11 @@ static GstBusSyncReply bus_sync_handler(GstBus * bus, GstMessage * msg, Interfac
gst_StartsWith(GST_OBJECT_NAME(msg->src), GstPluginNameVMX) == true))
{
MW_LOG_MIL("InterfacePlayerRDK setting encrypted player (%p) instance for %s decryptor", pInterfacePlayerRDK->mEncrypt, GST_OBJECT_NAME(msg->src));
GValue val = { 0, };
g_value_init(&val, G_TYPE_POINTER);

g_value_set_pointer(&val, (gpointer) pInterfacePlayerRDK->mDRMSessionManager); // encryption is being passed by player

g_object_set_property(G_OBJECT(msg->src), privatePlayer->mPlayerName.c_str(), &val);
GValue val_drm = { 0, };
g_value_init(&val_drm, G_TYPE_POINTER);
g_value_set_pointer(&val_drm, (gpointer) pInterfacePlayerRDK->mEncrypt);
g_object_set_property(G_OBJECT(msg->src), "drm-session-manager", &val_drm);
// Set both properties atomically to avoid potential use-after-free if property notifications trigger unrefs
g_object_set(msg->src,
privatePlayer->mPlayerName.c_str(), pInterfacePlayerRDK->mDRMSessionManager,
"drm-session-manager", pInterfacePlayerRDK->mEncrypt,
NULL);
}
}
break;
Expand Down
10 changes: 7 additions & 3 deletions externals/PlayerExternalsInterfaceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ class PlayerExternalsInterfaceBase
return false;
}

g_object_get(m_gstElement, "video_height", &sourceHeight, NULL);
g_object_get(m_gstElement, "video_width", &sourceWidth, NULL);
// Read both properties in a single g_object_get() call to avoid re-reading m_gstElement between calls
GstElement* element = m_gstElement;
g_object_get(element,
"video_height", &sourceHeight,
"video_width", &sourceWidth,
NULL);

if(sourceWidth != m_sourceWidth || sourceHeight != m_sourceHeight) {
MW_LOG_WARN("viddec (%p) --> says width %d, height %d", m_gstElement, sourceWidth, sourceHeight);
MW_LOG_WARN("viddec (%p) --> says width %d, height %d", element, sourceWidth, sourceHeight);
m_sourceWidth = sourceWidth;
m_sourceHeight = sourceHeight;
}
Expand Down
Loading