Permalink
Browse files

Dismiss photo being currently displayed when video is about to start.

Create the notification on demand when a photo is about to be displayed so we can discard it later.

There's still something not quite right when transitioning between photos and videos. The iPhone tends to disconnect the session. I suspect the delay we take in providing playback feedback to be the cause
  • Loading branch information...
jyavenard committed Jul 17, 2013
1 parent ff1dc56 commit 4ad170088f99123882ff21d730f65473144814a0
Showing with 16 additions and 7 deletions.
  1. +16 −7 mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
@@ -558,10 +558,12 @@ void MythAirplayServer::deleteConnection(QTcpSocket *socket)
.arg(remove.data()));
m_connections.remove(remove);
// close any photos that could be displayed
MythUINotificationCenter::GetInstance()->UnRegister(this, m_id);
m_id = -1;
if (m_id > 0)
{
// close any photos that could be displayed
MythUINotificationCenter::GetInstance()->UnRegister(this, m_id);
m_id = -1;
}
MythNotification n(tr("Client disconnected"), tr("AirPlay"),
tr("from %1").arg(socket->peerAddress().toString()));
MythUINotificationCenter::GetInstance()->Queue(n);
@@ -705,9 +707,6 @@ void MythAirplayServer::HandleResponse(APHTTPRequest *req,
MythNotification n(tr("New Connection"), tr("AirPlay"),
tr("from %1").arg(socket->peerAddress().toString()));
MythUINotificationCenter::GetInstance()->Queue(n);
m_id = MythUINotificationCenter::GetInstance()->Register(this);
}
double position = 0.0f;
@@ -829,6 +828,10 @@ void MythAirplayServer::HandleResponse(APHTTPRequest *req,
LOG(VB_GENERAL, LOG_INFO, LOC +
QString("Received %1 photo").arg(png ? "jpeg" : "png"));
if (m_id < 0)
{
m_id = MythUINotificationCenter::GetInstance()->Register(this);
}
// send full screen display notification
MythImageNotification n(MythNotification::New, image);
n.SetId(m_id);
@@ -1147,6 +1150,12 @@ void MythAirplayServer::StartPlayback(const QString &pathname)
gCoreContext->WaitUntilSignals(SIGNAL(TVPlaybackStarted()),
SIGNAL(TVPlaybackAborted()),
NULL);
if (TV::IsTVRunning() && m_id > 0)
{
// playback has started, dismiss the photo is we were showing one
MythUINotificationCenter::GetInstance()->UnRegister(this, m_id);
m_id = -1;
}
LOG(VB_PLAYBACK, LOG_DEBUG, LOC +
QString("ACTION_HANDLEMEDIA completed"));
}

0 comments on commit 4ad1700

Please sign in to comment.