Revision: 9421
Author: [email protected]
Date: Wed Jan 13 19:53:52 2010
Log: Fix for playing .3gp file
http://code.google.com/p/mobicents/source/detail?r=9421
Modified:
/trunk/servers/media/core/controllers/rtsp/src/main/java/org/mobicents/media/server/ctrl/rtsp/PlayAction.java
/trunk/servers/media/core/server-impl/src/main/java/org/mobicents/media/server/impl/resource/video/AVPlayer.java
=======================================
---
/trunk/servers/media/core/controllers/rtsp/src/main/java/org/mobicents/media/server/ctrl/rtsp/PlayAction.java
Wed Jan 13 09:06:17 2010
+++
/trunk/servers/media/core/controllers/rtsp/src/main/java/org/mobicents/media/server/ctrl/rtsp/PlayAction.java
Wed Jan 13 19:53:52 2010
@@ -99,7 +99,7 @@
}
}
- System.out.println("RTP-INfo = "+ rtpInfo+ " NPT = "+
npt);
+ //System.out.println("RTP-INfo = "+ rtpInfo+ " NPT = "+
npt);
player.start();
}
=======================================
---
/trunk/servers/media/core/server-impl/src/main/java/org/mobicents/media/server/impl/resource/video/AVPlayer.java
Tue Jan 12 21:10:05 2010
+++
/trunk/servers/media/core/server-impl/src/main/java/org/mobicents/media/server/impl/resource/video/AVPlayer.java
Wed Jan 13 19:53:52 2010
@@ -93,7 +93,7 @@
public void setSSRC(String media, long ssrc) {
- System.out.println("setSSRC media = " + media + " ssrc = " +
ssrc);
+ //System.out.println("setSSRC media = " + media + " ssrc = " +
ssrc);
String mediaType = getMediaType(media);
if (mediaType.equals("audio")) {
@@ -104,7 +104,7 @@
}
public void setRtpTime(String media, long rtpTime) {
- System.out.println("setRtpTime media = " + media + " ssrc = " +
rtpTime);
+ //System.out.println("setRtpTime media = " + media + " ssrc = " +
rtpTime);
String mediaType = getMediaType(media);
if (mediaType.equals("audio")) {
@@ -388,16 +388,16 @@
if (audioSource.getTrackId() != -1) {
tracks.put("trackID=" + audioSource.getTrackId(),
"audio");
- System.out.println("Set the Audio TrackId "+ audioSource.getTrackId()
+ " ***********");
+ //System.out.println("Set the Audio TrackId "+
audioSource.getTrackId() + " ***********");
}
if (videoSource.getTrackId() != -1) {
tracks.put("trackID=" + videoSource.getTrackId(),
"video");
- System.out.println("Set the Video TrackId "+ videoSource.getTrackId()
+ " ***********");
+ //System.out.println("Set the Video TrackId "+
videoSource.getTrackId() + " ***********");
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("Setting of URL failed for AVPlayer", e);
}
}
@@ -447,7 +447,7 @@
@Override
public void beforeStart() throws Exception {
- System.out.println("AudioSource.beforeStart()");
+ //System.out.println("AudioSource.beforeStart()");
this.eom = false;
}
@@ -476,6 +476,11 @@
}
packets =
rtpSample.getRtpLocalPackets();
duration = rtpSample.getSamplePeriod();
+ if(packets.length == 0){
+ buffer.setLength(0);
+ buffer.setDuration(duration);
+ return;
+ }
idx = 0;
isEmpty = false;
} catch (Exception e) {
@@ -505,7 +510,8 @@
try {
prepareTracks();
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("pprepareTracks failed for
AudioSource", e);
+ //e.printStackTrace();
// TODO : Throw exception
}
}
@@ -579,7 +585,7 @@
@Override
public void beforeStart() throws Exception {
- System.out.println("VideoSource.beforeStart()");
+ //System.out.println("VideoSource.beforeStart()");
this.eom = false;
}
@@ -639,7 +645,8 @@
try {
prepareTracks();
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("prepareTracks failed for
VideoSource", e);
+ //e.printStackTrace();
// TODO : Throw exception
}