Revision: ed5fb4b22a9c
Author:   Ivelin Ivanov <[email protected]>
Date:     Fri Jan  4 20:48:06 2013
Log:      - current clock rate was updated on every packet, which seemed
excessive. Now it is updated when the RTP packet payload type (format)
changes.
http://code.google.com/p/mediaserver/source/detail?r=ed5fb4b22a9c

Modified:
 /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java

=======================================
--- /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java Fri Jan 4 14:06:44 2013 +++ /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java Fri Jan 4 20:48:06 2013
@@ -217,6 +217,10 @@
        {
                this.format=format;
                logger.info("Format has been changed: " + 
this.format.toString());
+
+ //Since the RTP packet Payload Type (format) changed, it is possible that the sampling rate/clock rate is different for the new format + // update current clock rate we use to convert timestamp units to absolute time and vice versa
+               rtpClock.setClockRate(this.format.getClockRate());
        }

        //if this is first packet then synchronize clock
@@ -228,9 +232,6 @@
        else
             estimateJitter(packet);

-       //update clock rate
-       rtpClock.setClockRate(this.format.getClockRate());
-
        Frame f=null;
        //drop outstanding packets
                //packet is outstanding if its timestamp of arrived packet is 
less

Reply via email to