Skip to content

Commit

Permalink
Make BD player reports errors so we can exit early.
Browse files Browse the repository at this point in the history
Exit early if no title has been found
  • Loading branch information
jyavenard committed Jul 7, 2013
1 parent 227de45 commit fb55859
Showing 1 changed file with 42 additions and 30 deletions.
72 changes: 42 additions & 30 deletions mythtv/libs/libmythtv/Bluray/bdringbuffer.cpp
Expand Up @@ -312,6 +312,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)

if (!bdnav)
{
lastError = QObject::tr("Couldn't open Blu-ray device: %1").arg(filename);
rwlock.unlock();
mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL);
return false;
Expand All @@ -335,36 +336,6 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
m_topMenuSupported = false;
m_firstPlaySupported = false;
const BLURAY_DISC_INFO *discinfo = bd_get_disc_info(bdnav);
if (discinfo)
{
m_topMenuSupported = discinfo->top_menu_supported;
m_firstPlaySupported = discinfo->first_play_supported;

LOG(VB_PLAYBACK, LOG_INFO, LOC + "*** Blu-ray Disc Information ***");
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("First Play Supported: %1")
.arg(discinfo->first_play_supported ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Top Menu Supported: %1")
.arg(discinfo->top_menu_supported ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Number of HDMV Titles: %1")
.arg(discinfo->num_hdmv_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Number of BD-J Titles: %1")
.arg(discinfo->num_bdj_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("Number of Unsupported Titles: %1")
.arg(discinfo->num_unsupported_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("AACS present on disc: %1")
.arg(discinfo->aacs_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("libaacs used: %1")
.arg(discinfo->libaacs_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("AACS handled: %1")
.arg(discinfo->aacs_handled ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("BD+ present on disc: %1")
.arg(discinfo->bdplus_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("libbdplus used: %1")
.arg(discinfo->libbdplus_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("BD+ handled: %1")
.arg(discinfo->bdplus_handled ? "yes" : "no"));
}

// The following settings affect HDMV navigation
// (default audio track selection,
Expand Down Expand Up @@ -405,6 +376,47 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
m_numTitles = bd_get_titles(bdnav, TITLES_RELEVANT, 30);
LOG(VB_GENERAL, LOG_INFO, LOC +
QString("Found %1 titles.").arg(m_numTitles));
if (!m_numTitles)
{
// no title, no point trying any longer
bd_close(bdnav);
bdnav = NULL;
lastError = QObject::tr("Can't find any Blu-ray-compatible title");
rwlock.unlock();
mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL);
return false;
}

if (discinfo)
{
m_topMenuSupported = discinfo->top_menu_supported;
m_firstPlaySupported = discinfo->first_play_supported;

LOG(VB_PLAYBACK, LOG_INFO, LOC + "*** Blu-ray Disc Information ***");
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("First Play Supported: %1")
.arg(discinfo->first_play_supported ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Top Menu Supported: %1")
.arg(discinfo->top_menu_supported ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Number of HDMV Titles: %1")
.arg(discinfo->num_hdmv_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Number of BD-J Titles: %1")
.arg(discinfo->num_bdj_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("Number of Unsupported Titles: %1")
.arg(discinfo->num_unsupported_titles));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("AACS present on disc: %1")
.arg(discinfo->aacs_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("libaacs used: %1")
.arg(discinfo->libaacs_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("AACS handled: %1")
.arg(discinfo->aacs_handled ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("BD+ present on disc: %1")
.arg(discinfo->bdplus_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("libbdplus used: %1")
.arg(discinfo->libbdplus_detected ? "yes" : "no"));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("BD+ handled: %1")
.arg(discinfo->bdplus_handled ? "yes" : "no"));
}
m_mainTitle = 0;
m_currentTitleLength = 0;
m_titlesize = 0;
Expand Down

0 comments on commit fb55859

Please sign in to comment.