jflasch

janus_videoroom.c.new.patch

Sep 17th, 2019
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c
  2. index 7dd182b..86669ac 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. @@ -4750,7 +4751,7 @@ static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
  14. /* Already hung up */
  15. if (!s->feed) {
  16. return;
  17. - }
  18. + }
  19. /* Check if the owner needs to be cleaned up */
  20. if(s->pvt_id > 0 && s->room != NULL) {
  21. janus_mutex_lock(&s->room->mutex);
  22. @@ -4764,14 +4765,16 @@ static void janus_videoroom_hangup_subscriber(janus_videoroom_subscriber * s) {
  23. janus_mutex_unlock(&s->room->mutex);
  24. }
  25. /* TODO: are we sure this is okay as other handlers use feed directly without synchronization */
  26. - if(s->feed)
  27. - g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
  28. - if(s->room)
  29. - g_clear_pointer(&s->room, janus_videoroom_room_dereference);
  30. - if(s->session && s->close_pc)
  31. - gateway->close_pc(s->session->handle);
  32. - /* Done with the subscriber and free its reference */
  33. - janus_refcount_decrease(&s->ref);
  34. + if(s->feed)
  35. + g_clear_pointer(&s->feed, janus_videoroom_publisher_dereference_by_subscriber);
  36. + if(s->close_pc) {
  37. + if(s->room)
  38. + g_clear_pointer(&s->room, janus_videoroom_room_dereference);
  39. + if(s->session)
  40. + gateway->close_pc(s->session->handle);
  41. + /* Done with the subscriber and free its reference */
  42. + janus_refcount_decrease(&s->ref);
  43. + }
  44. }
  45.  
  46. static void janus_videoroom_hangup_media_internal(janus_plugin_session *handle) {
Add Comment
Please, Sign In to add comment