Commit 2c80a54f authored by Christian Strømme's avatar Christian Strømme Committed by Christian Stromme
Browse files

GStreamer: Only register one typefind function


Each time a GStreamer session was created it would register the same
callback function, but each time with a new user data, which in our
case was a pointer to the session. The pointer would then be used
without verification of its validity. The problem with this is that
the typefind function is static and used for all sessions, making
multiple sessions impossible.
The documentation for gst_type_find_register() also clearly specifies
that the supplied user data needs to valid as long as the plugin is
loaded, which of course was not the case.

With this change only one callback function will be registered, and
each session will register itself with a typefind delegate, that will
keep track of sessions that are still alive.

Note: This only makes sure that the typefind function is called on
a valid session, it does not make sure that the type actually
belong to the session, which is a separate issue.

Task-number: QTBUG-50460
Change-Id: I20eeabfe4e85839e8845003298d6f64705c2e15e
Reviewed-by: default avatarYoann Lopes <yoann.lopes@qt.io>
parent 5b06e7d9
No related merge requests found
Showing with 56 additions and 12 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment