Skip to content

Commit

Permalink
wrap GetStreamDetails in try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Nov 18, 2012
1 parent 2620d2a commit 94372af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -3075,12 +3075,15 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const

bool retVal = false;

CStreamDetails& details = tag.m_streamDetails;
details.Reset();

auto_ptr<Dataset> pDS(m_pDB->CreateDataset());
try
{
CStdString strSQL = PrepareSQL("SELECT * FROM streamdetails WHERE idFile = %i", tag.m_iFileId);
pDS->query(strSQL);

CStreamDetails& details = tag.m_streamDetails;
details.Reset();
while (!pDS->eof())
{
CStreamDetail::StreamType e = (CStreamDetail::StreamType)pDS->fv(1).get_asInt();
Expand Down Expand Up @@ -3125,6 +3128,11 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const
}

pDS->close();
}
catch (...)
{
CLog::Log(LOGERROR, "%s(%i) failed", __FUNCTION__, tag.m_iFileId);
}
details.DetermineBestStreams();

if (details.GetVideoDuration() > 0)
Expand Down

0 comments on commit 94372af

Please sign in to comment.