http_streamer: improve IsRunning() safeness

This commit is contained in:
Dario Casalinuovo 2016-10-23 03:25:41 +02:00
parent 3798bf90cb
commit e42135e574
1 changed files with 4 additions and 3 deletions

View File

@ -195,11 +195,12 @@ HTTPMediaIO::Open()
bool
HTTPMediaIO::IsRunning() const
{
BHttpRequest* httpReq = dynamic_cast<BHttpRequest*>(fReq);
if (httpReq != NULL)
if (fListener != NULL)
return fListener->IsRunning();
else
else if (fReq != NULL)
return fReq->IsRunning();
return false;
}