Exception catch for boost::any_cast in buffers_status_cb_ rarely when buffer underrun
authorchuan.jiang <chuan.jiang@samsung.com>
Tue, 14 Nov 2023 09:37:45 +0000 (17:37 +0800)
committerchuan.jiang <chuan.jiang@samsung.com>
Tue, 14 Nov 2023 09:37:45 +0000 (17:37 +0800)
src/esplusplayer/src/esplayer.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index fc6e940..3124ef8
@@ -1347,8 +1347,12 @@ void EsPlayer::GetSrcQueueCurrentSize_(const TrackType& type,
         &time_size_);
   } else
     return;
-  *byte_size = boost::any_cast<std::uint64_t>(byte_size_);
-  *time_size = boost::any_cast<std::uint64_t>(time_size_);
+  try {
+    *byte_size = boost::any_cast<std::uint64_t>(byte_size_);
+    *time_size = boost::any_cast<std::uint64_t>(time_size_);
+  } catch (...) {
+    LOG_INFO_P(this, "any_cast failed");
+  }
   if (time_unit_type == kPlayerTimeUnitTypeMs)
     *time_size = util::ConvertNsToMs(*time_size);
   else if (time_unit_type == kPlayerTimeUnitTypeUs)