Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multistream/videoroom: data_mindex not set to the correct value #2647

Closed
mgarabedian opened this issue Apr 28, 2021 · 4 comments
Closed

multistream/videoroom: data_mindex not set to the correct value #2647

mgarabedian opened this issue Apr 28, 2021 · 4 comments

Comments

@mgarabedian
Copy link

While attempting a videoroom recording ( multistream branch ), I came across a bug on the data mjr recording. Data was being saved in the audio mjr file, instead of the data mjr file (which was blank).

Digging in further, it appears participant->data_mindex is never updated in the plugin. I was able to solve this issue with the following code:

in janus_videroom.c

/* Add the stream to the list, if it's new */
if(new_ps) {
  participant->streams = g_list_append(participant->streams, ps);
  //FIX
  if(ps->type == JANUS_VIDEOROOM_MEDIA_DATA){
	  participant->data_mindex = ps->mindex;
  }
  //END FIX
  g_hash_table_insert(participant->streams_byid, GINT_TO_POINTER(ps->mindex), ps);
  g_hash_table_insert(participant->streams_bymid, g_strdup(ps->mid), ps);
}
@lminiero
Copy link
Member

Good catch! Looking at the code, I suspect this wasn't just preventing data recording, but data channel braodcasting to other subscribers as well, especially in cases where data subscribers and audio subscribers didn't match. I'll fix this as suggested 👍

@mgarabedian
Copy link
Author

Great, thanks. It looks like the code should also be added to janus_videoroom_multistream.c

@lminiero
Copy link
Member

There's no such thing: there's just a single VideoRoom plugin.

@mgarabedian
Copy link
Author

Apologies. That was something I was trying on my end. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants