rsked/vlcplayer.cc
/// If the player has made no progress in elapsed time (no change)
/// for m_stalls_max number of checks then throw a Player_media_exception.
/// (Tune parameter to ride out brief connection issues.)
/// Will neither check nor alert if the source is marked as "may-be-quiet".
///
/// * May THROW: Player_exception
///
If the player has made no progress in elapsed time (no change)
for m_stalls_max number of checks then throw a Player_media_exception.
(Tune parameter to ride out brief connection issues.)
Will neither check nor alert if the source is marked as "may-be-quiet".


If the player has made no progress in elapsed time ( no change ) for m_stalls_max number of checks then throw a Player_media_exception . ( Tune parameter to ride out brief connection issues . ) Will neither check nor alert if the source is marked as " may - be - quiet " .
void Vlc_player::check_not_stalled()
{
    if (m_src->may_be_quiet()) {
        return;
    }
    try {
        do_command("get_time\n",true);
        unsigned long u {0};
        if (not parse_unsigned(m_last_resp,u)) { 
            u = m_last_elapsed_secs;
        } else {
            LOG_DEBUG(Lgr) << m_name << " elapsed_secs=" << u;
        }
        if (u == m_last_elapsed_secs) {
            ++m_stall_counter;
            LOG_WARNING(Lgr) << "Vlc_player stall_counter=" << m_stall_counter;
        } else {
            if (m_stall_counter) {
                LOG_DEBUG(Lgr) << "Vlc_player stall_counter reset to 0";
                m_stall_counter = 0;
            }
            m_last_elapsed_secs = u;
        }
    } catch (const std::exception &err) {
        LOG_WARNING(Lgr) << m_name << " error checking not stalled:" << err.what();
        throw Player_media_exception();
    }
    if (m_stall_counter > m_stalls_max) {
        LOG_WARNING(Lgr) << m_name << " stalled on source {"
                         << m_src->name() << "}";
        throw Player_media_exception();
    }
}
void Vlc_player :: check_not_stalled ( ) { if ( m_src -> may_be_quiet ( ) ) { return ; } try { do_command ( " \n " , true ) ; unsigned long u { 0 } ; if ( not parse_unsigned ( m_last_resp , u ) ) { u = m_last_elapsed_secs ; } else { LOG_DEBUG ( Lgr ) << m_name << " " << u ; } if ( u == m_last_elapsed_secs ) { ++ m_stall_counter ; LOG_WARNING ( Lgr ) << " " << m_stall_counter ; } else { if ( m_stall_counter ) { LOG_DEBUG ( Lgr ) << " " ; m_stall_counter = 0 ; } m_last_elapsed_secs = u ; } } catch ( const std :: exception & err ) { LOG_WARNING ( Lgr ) << m_name << " " << err . what ( ) ; throw Player_media_exception ( ) ; } if ( m_stall_counter > m_stalls_max ) { LOG_WARNING ( Lgr ) << m_name << " " << m_src -> name ( ) << " " ; throw Player_media_exception ( ) ; } }
If the player has made no progress in elapsed time (no change)
for m_stalls_max number of checks then throw a Player_media_exception.
If the player has made no progress in elapsed time ( no change ) for m_stalls_max number of checks then throw a Player_media_exception .
// no number returned // LOG_DEBUG(Lgr) << m_name << " no progress reported...maybe stalled"; // Note that u might jump down if src is a directory or playlist // since it reads the time in the individual /track/.