jflasch

janus_videoroom.c.patch

Sep 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c
  2. index 7dd182b..3adf41b 100644
  3. --- a/plugins/janus_videoroom.c
  4. +++ b/plugins/janus_videoroom.c
  5. @@ -2442,6 +2442,7 @@ void janus_videoroom_destroy_session(janus_plugin_session *handle, int *error) {
  6. session->participant = NULL;
  7. if(s->room) {
  8. janus_refcount_decrease(&s->room->ref);
  9. + janus_refcount_decrease(&s->ref);
  10. }
  11. janus_videoroom_subscriber_destroy(s);
  12. }
  13. @@ -4749,8 +4750,11 @@ void janus_videoroom_hangup_media(janus_plugin_session *handle) {
  14. static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
  15. /* Already hung up */
  16. if (!s->feed) {
  17. + JANUS_LOG(LOG_INFO, "videroom_hangup_subscriber NO FEED %p \n", &s->ref);
  18. return;
  19. - }
  20. + } else {
  21. + JANUS_LOG(LOG_INFO, "videroom_hangup_subscriber %p \n", &s->ref);
  22. + }
  23. /* Check if the owner needs to be cleaned up */
  24. if(s->pvt_id > 0 && s->room != NULL) {
  25. janus_mutex_lock(&s->room->mutex);
  26. @@ -4764,14 +4768,16 @@ static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
  27. janus_mutex_unlock(&s->room->mutex);
  28. }
  29. /* TODO: are we sure this is okay as other handlers use feed directly without synchronization */
  30. - if(s->feed)
  31. - g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
  32. - if(s->room)
  33. - g_clear_pointer(&s->room, janus_videoroom_room_dereference);
  34. - if(s->session && s->close_pc)
  35. - gateway->close_pc(s->session->handle);
  36. - /* Done with the subscriber and free its reference */
  37. - janus_refcount_decrease(&s->ref);
  38. + if(s->feed)
  39. + g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
  40. + if(s->close_pc) {
  41. + if(s->room)
  42. + g_clear_pointer(&s->room, janus_videoroom_room_dereference);
  43. + if(s->session)
  44. + gateway->close_pc(s->session->handle);
  45. + /* Done with the subscriber and free its reference */
  46. + janus_refcount_decrease(&s->ref);
  47. + }
  48. }
  49.  
  50. static void janus_videoroom_hangup_media_internal(janus_plugin_session *handle) {
Add Comment
Please, Sign In to add comment