File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,14 +265,22 @@ PublisherStats Publisher::stats() const {
265265 StatsSnapshot snapshot;
266266 bool split_cmaf_chunks = true ;
267267 bool include_sap = false ;
268+ std::shared_ptr<ActiveSession> active;
268269 {
269270 std::lock_guard<std::mutex> lock (state_mutex_);
270271 snapshot = stats_;
271272 split_cmaf_chunks = config_.split_cmaf_chunks ;
272273 include_sap = config_.include_sap ;
273- if (active_session_ && active_session_->transport ) {
274- snapshot.connection_id = active_session_->transport ->connection_id ();
275- }
274+ active = active_session_;
275+ }
276+ if (active && active->session ) {
277+ const auto live_stats = active->session ->publish_stats ();
278+ snapshot.bytes_published = live_stats.bytes_published ;
279+ snapshot.objects_published = live_stats.objects_published ;
280+ snapshot.groups_published = live_stats.groups_published ;
281+ }
282+ if (active && active->transport ) {
283+ snapshot.connection_id = active->transport ->connection_id ();
276284 }
277285
278286 return PublisherStats{
You can’t perform that action at this time.
0 commit comments