~phablet-team/media-hub/trunk

« back to all changes in this revision

Viewing changes to src/core/media/player_implementation.cpp

  • Committer: CI bot
  • Author(s): Ricardo Mendoza
  • Date: 2014-11-05 20:41:03 UTC
  • mfrom: (86.2.2 trunk)
  • Revision ID: ps-jenkins@lists.canonical.com-20141105204103-4nf86obpejume2cz
Use new hybris interface to correctly register for client deaths. Fixes: 1380848
Approved by: Jim Hodapp

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "engine.h"
25
25
#include "track_list_implementation.h"
26
26
 
 
27
#include <hybris/media/media_codec_layer.h>
27
28
#include "powerd_service.h"
28
29
#include "unity_screen_service.h"
29
30
#include "gstreamer/engine.h"
79
80
 
80
81
        auto uscreen_stub_service = dbus::Service::use_service(bus, dbus::traits::Service<core::UScreen>::interface_name());
81
82
        uscreen_session = uscreen_stub_service->object_for_path(dbus::types::ObjectPath("/com/canonical/Unity/Screen"));
 
83
 
 
84
        decoding_service_set_client_death_cb(&Private::on_client_died_cb, key, static_cast<void*>(this));
82
85
    }
83
86
 
84
87
    ~Private()
258
261
        };
259
262
    }
260
263
 
 
264
    static void on_client_died_cb(void *context)
 
265
    {
 
266
        if (context)
 
267
        {
 
268
            Private *p = static_cast<Private*>(context);
 
269
            p->on_client_died();
 
270
        }
 
271
    }
 
272
 
 
273
    void on_client_died()
 
274
    {
 
275
        engine->reset();
 
276
    }
 
277
 
261
278
    PlayerImplementation* parent;
262
279
    std::shared_ptr<Service> service;
263
280
    std::shared_ptr<Engine> engine;