nael-lilik / mconf

Automatically exported from code.google.com/p/mconf
0 stars 0 forks source link

show video crash when userId is same with part of resolution #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
bbb-java/src/org/mconf/bbb/video/IVideoListener.java:
public float getAspectRatio() {
String userIdStr = Integer.toString(userId);
if (streamName != null && streamName.contains(userIdStr)) {
String resStr = streamName.substring(0, streamName.indexOf(userIdStr));
String[] res = resStr.split("x");
int width = Integer.parseInt(res[0]),
height = Integer.parseInt(res[1]);
return width / (float) height;
}
return -1;
}

String resStr = streamName.substring(0, streamName.indexOf(userIdStr));
streamName=resolution+userIdStr, eg:streamName=320x24099 if userId=99, but if 
userId is same with part of resolution, e.g. 24, that is, when 
streamName=320x24024, resStr=320x, not 320x240
so why not use lastIndexOf instead of indexOf?

thanks

Original issue reported on code.google.com by shenxiao...@gmail.com on 29 Jul 2011 at 5:35

GoogleCodeExporter commented 9 years ago
I'm a newbie to mconf and issues system, so please help me if I'm wrong, thanks.

Original comment by shenxiao...@gmail.com on 29 Jul 2011 at 5:38

GoogleCodeExporter commented 9 years ago
Thank you for your contribution shenxiao, you seem to be right, and we will 
take a look on it.

https://github.com/mconf/mconf-mobile/blob/master/bbb-java/src/org/mconf/bbb/vid
eo/IVideoListener.java#L85

Original comment by fceca...@gmail.com on 29 Jul 2011 at 12:08

GoogleCodeExporter commented 9 years ago
Fixed by this commit:
https://github.com/mconf/mconf-mobile/commit/f5ed26e1dabbf68e907da572f474fc5fbae
58ffa

Also added tests for it.

Original comment by fceca...@gmail.com on 7 Aug 2011 at 11:25

GoogleCodeExporter commented 9 years ago

Original comment by fceca...@gmail.com on 29 Aug 2011 at 6:53