Merge lp:~phablet-team/qtubuntu-media/release-sink-properly into lp:qtubuntu-media

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Jim Hodapp
Approved revision: 118
Merged at revision: 117
Proposed branch: lp:~phablet-team/qtubuntu-media/release-sink-properly
Merge into: lp:qtubuntu-media
Diff against target: 15 lines (+5/-0)
1 file modified
src/aal/aalvideorenderercontrol.cpp (+5/-0)
To merge this branch: bzr merge lp:~phablet-team/qtubuntu-media/release-sink-properly
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
Review via email: mp+317180@code.launchpad.net

Commit message

Release sink before creating a new one so resources are properly freed.

Description of the change

Release sink before creating a new one so resources are properly freed.

To post a comment you must log in.
Revision history for this message
Jim Hodapp (jhodapp) wrote :

One minor thing to fix.

review: Needs Fixing (code)
118. By Alfonso Sanchez-Beato

Address review comments

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Review comment addressed, also added a comment for further clarification.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/aal/aalvideorenderercontrol.cpp'
2--- src/aal/aalvideorenderercontrol.cpp 2016-07-20 21:26:54 +0000
3+++ src/aal/aalvideorenderercontrol.cpp 2017-02-20 08:34:55 +0000
4@@ -274,6 +274,11 @@
5 {
6 if (m_textureId == 0) {
7 m_textureId = static_cast<GLuint>(textureID);
8+ // Remove old instance first (assignment first creates the new object,
9+ // then removes the old one, but we need the resources from the old
10+ // object to create the new one, so we force the right order with an
11+ // initial pointer reset).
12+ m_videoSink.reset();
13 m_videoSink = m_service->createVideoSink(textureID);
14 if (not m_videoSink)
15 {

Subscribers

People subscribed via source and target branches

to all changes: