Exemple #1
0
PrivateDecoderCrystalHD::~PrivateDecoderCrystalHD()
{
    if (m_fetcher_thread)
    {
        m_fetcher_pause = true;
        m_fetcher_stop = true;
        int tries = 0;
        while (!m_fetcher_thread->wait(100) && (tries++ < 50))
            VERBOSE(VB_PLAYBACK, WARN + "Waited 100ms for Fetcher to stop");

        if (m_fetcher_thread->isRunning())
            VERBOSE(VB_IMPORTANT, ERR + "Failed to stop Fetcher.");
        else
            VERBOSE(VB_PLAYBACK, LOC + "Stopped frame Fetcher.");
        delete m_fetcher_thread;
    }

    if (m_filter)
        av_bitstream_filter_close(m_filter);

    Reset();
    if (!m_device)
        return;

    INIT_ST
    if (m_device_type != BC_70015)
    {
        st = DtsFlushRxCapture(m_device, false);
        CHECK_ST
    }
PrivateDecoderCrystalHD::~PrivateDecoderCrystalHD()
{
    if (m_fetcher_thread)
    {
        m_fetcher_pause = true;
        m_fetcher_stop = true;
        int tries = 0;
        while (!m_fetcher_thread->wait(100) && (tries++ < 50))
            LOG(VB_PLAYBACK, LOG_WARNING, LOC +
                "Waited 100ms for Fetcher to stop");

        if (m_fetcher_thread->isRunning())
            LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to stop Fetcher.");
        else
            LOG(VB_PLAYBACK, LOG_INFO, LOC + "Stopped frame Fetcher.");
        delete m_fetcher_thread;
    }

    if (m_filter)
        av_bitstream_filter_close(m_filter);

    Reset();
    if (!m_device)
        return;

    INIT_ST;
    if (m_device_type != BC_70015)
    {
        st = DtsFlushRxCapture(m_device, false);
        CHECK_ST;
    }
    st = DtsStopDecoder(m_device);
    CHECK_ST;
    st = DtsCloseDecoder(m_device);
    CHECK_ST;
    DtsDeviceClose(m_device);
}