Skip to content
This repository
Browse code

wrap GetStreamDetails in try/catch

  • Loading branch information...
commit 94372afd6cc4b3a840d4e2efbbfd22a2dd9f130e 1 parent 2620d2a
authored November 18, 2012

Showing 1 changed file with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. 12  xbmc/video/VideoDatabase.cpp
12  xbmc/video/VideoDatabase.cpp
@@ -3075,12 +3075,15 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const
3075 3075
 
3076 3076
   bool retVal = false;
3077 3077
 
  3078
+  CStreamDetails& details = tag.m_streamDetails;
  3079
+  details.Reset();
  3080
+
3078 3081
   auto_ptr<Dataset> pDS(m_pDB->CreateDataset());
  3082
+  try
  3083
+  {
3079 3084
   CStdString strSQL = PrepareSQL("SELECT * FROM streamdetails WHERE idFile = %i", tag.m_iFileId);
3080 3085
   pDS->query(strSQL);
3081 3086
 
3082  
-  CStreamDetails& details = tag.m_streamDetails;
3083  
-  details.Reset();
3084 3087
   while (!pDS->eof())
3085 3088
   {
3086 3089
     CStreamDetail::StreamType e = (CStreamDetail::StreamType)pDS->fv(1).get_asInt();
@@ -3125,6 +3128,11 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const
3125 3128
   }
3126 3129
 
3127 3130
   pDS->close();
  3131
+  }
  3132
+  catch (...)
  3133
+  {
  3134
+    CLog::Log(LOGERROR, "%s(%i) failed", __FUNCTION__, tag.m_iFileId);
  3135
+  }
3128 3136
   details.DetermineBestStreams();
3129 3137
 
3130 3138
   if (details.GetVideoDuration() > 0)

0 notes on commit 94372af

Please sign in to comment.
Something went wrong with that request. Please try again.