Skip to content
Snippets Groups Projects
Commit ea07dba5 authored by Richard Alam's avatar Richard Alam
Browse files

- putting timestamp into audio...if connection to a client is slow...audio packets are dropped.

   (Which one do we prefer? Dropped audio or lag?)
parent b260c08f
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,6 @@ public class CallStream implements StreamObserver {
throw new Exception("Exception while initializing CallStream");
}
Transcoder rtmpToRtpTranscoder, rtpToRtmpTranscoder;
if (sipCodec.getCodecId() == SpeexCodec.codecId) {
rtmpToRtpTranscoder = new SpeexToSpeexTranscoder(sipCodec);
......
......@@ -20,6 +20,7 @@ public class SipToFlashAudioStream implements TranscodedAudioDataListener, RtpSt
private final String listenStreamName;
private RtpStreamReceiver rtpStreamReceiver;
private StreamObserver observer;
private long startTimestamp;
public SipToFlashAudioStream(IScope scope, Transcoder transcoder, DatagramSocket socket) {
this.scope = scope;
......@@ -62,7 +63,7 @@ public class SipToFlashAudioStream implements TranscodedAudioDataListener, RtpSt
log.error("could not register broadcast stream");
throw new RuntimeException("could not register broadcast stream");
}
startTimestamp = System.currentTimeMillis();
audioBroadcastStream.start();
rtpStreamReceiver.start();
}
......@@ -71,7 +72,10 @@ public class SipToFlashAudioStream implements TranscodedAudioDataListener, RtpSt
/* NOTE:
* Don't set the timestamp as it results in choppy audio. Let the client
* play the audio as soon as they receive the packets. (ralam dec 10, 2009)
*
* Let's try this out...if connection to client is slow...audio should be dropped.
*/
audioData.setTimestamp((int)(System.currentTimeMillis() - startTimestamp));
audioBroadcastStream.dispatchEvent(audioData);
audioData.release();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment