[jitsi-dev] [jitsi-commits] master: Parses 'opus/48000' as 'opus/48000/2' for better interoperability. (2a68a54)


#1

Wouldn't there be a less hacky way to create the attribute properly?
It just looks a bit too dodgy having a string comparison for a specific codec in common code...

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

···

Le 28.07.2014 à 23:09, "boris@jitsi.org" <boris@jitsi.org> a écrit :

Repository : ssh://lists.jitsi.org/jitsi

On branch : master
Link : https://github.com/jitsi/jitsi/compare/3e271c423d189f74ac4debefb391c3906c0acd10...2a68a54342e4d9fd5c8aa7ac599cb84afab4abe2

---------------------------------------------------------------

commit 2a68a54342e4d9fd5c8aa7ac599cb84afab4abe2
Author: Boris Grozev <boris@jitsi.org>
Date: Mon Jul 28 18:03:52 2014 +0300

   Parses 'opus/48000' as 'opus/48000/2' for better interoperability.

---------------------------------------------------------------

2a68a54342e4d9fd5c8aa7ac599cb84afab4abe2
.../impl/protocol/sip/sdp/SdpUtils.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java b/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java
index 1bf5bc1..fd53672 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java
@@ -273,7 +273,7 @@ public class SdpUtils
        else
        {
            //if rtpmap was null, check whether we have previously registered
- //the type in our dynamiyc payload type registry. and if that's
+ //the type in our dynamic payload type registry. and if that's
            //the case return it.
            MediaFormat fmt = ptRegistry.findFormat(payloadType);
            if (fmt != null)
@@ -290,6 +290,12 @@ public class SdpUtils
        if (advp != null)
            advancedAttrMap = parseAdvancedAttributes(advp);

+ // Many implementations use opus as "opus/48000", while the specification
+ // mandates "opus/48000/2". Our upper layers only support 2 channels, so
+ // we patch it here.
+ if ("opus".equals(encoding))
+ numChannels = 2;
+
        //now create the format.
        MediaFormat format
            = SipActivator.getMediaService().getFormatFactory()

_______________________________________________
commits mailing list
commits@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/commits


#2

Hey, Ingo

Wouldn't there be a less hacky way to create the attribute properly?
It just looks a bit too dodgy having a string comparison for a specific codec in common code...

I agree, of course, that this is dodgy and hacky, but I don't see a more clean and sufficiently simple solution. We don't have an opus format with one channel in libjitsi, so calling MediaFormatFactory#createFormat() returns null if we ask for opus with one channel.

Regards,
Boris

···

On 29/07/14 05:18, Ingo Bauersachs wrote:


#3

The "proper" way would be to announce the valid and the wrong format
together but that would be much hackier and would likely break more stuff
than it would repair

--sent from my mobile

···

On 29 Jul 2014 10:06 AM, "Boris Grozev" <boris@jitsi.org> wrote:

Hey, Ingo

On 29/07/14 05:18, Ingo Bauersachs wrote:

Wouldn't there be a less hacky way to create the attribute properly?
It just looks a bit too dodgy having a string comparison for a specific
codec in common code...

I agree, of course, that this is dodgy and hacky, but I don't see a more
clean and sufficiently simple solution. We don't have an opus format with
one channel in libjitsi, so calling MediaFormatFactory#createFormat()
returns null if we ask for opus with one channel.

Regards,
Boris

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev