summaryrefslogtreecommitdiff
path: root/gtk/rtp_player.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2008-01-08 13:04:50 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2008-01-08 13:04:50 +0000
commit670e46f78b38369b68f30bece398174f4093af1c (patch)
treed7ec9b78cd741416c277f8288d864c3ca2ec9ef2 /gtk/rtp_player.c
parentc0dc9306893bf6af75eab1a0a9e7712854149670 (diff)
downloadwireshark-670e46f78b38369b68f30bece398174f4093af1c.tar.gz
Make RTP player G.729 Annex B compatible.
svn path=/trunk/; revision=24032
Diffstat (limited to 'gtk/rtp_player.c')
-rw-r--r--gtk/rtp_player.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/rtp_player.c b/gtk/rtp_player.c
index 8e00471854..099f48e50c 100644
--- a/gtk/rtp_player.c
+++ b/gtk/rtp_player.c
@@ -512,7 +512,9 @@ decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash
#ifdef HAVE_G729_G723
case PT_G729: /* G.729 */
- tmp_buff = g_malloc(sizeof(SAMPLE) * rp->info->info_payload_len * 8); /* G729 8kbps => 64kbps/8kbps = 8 */
+ /* G729 8kbps => 64kbps/8kbps = 8 */
+ /* Compensate for possible 2 octet SID frame (G.729B) */
+ tmp_buff = g_malloc(sizeof(SAMPLE) * ((rp->info->info_payload_len + 8) / 10) * 80);
decodeG729(rp->payload_data, rp->info->info_payload_len,
tmp_buff, &decoded_bytes);
break;
@@ -733,21 +735,25 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_)
if (diff<0) diff = -diff;
total_time = (double)rp->arrive_offset/1000;
-
+#if DEBUG
printf("seq = %d arr = %f abs_diff = %f index = %d tim = %f ji=%d jb=%f\n",rp->info->info_seq_num,
total_time, diff, rci->samples->len, ((double)rci->samples->len/8000 - total_time)*1000, 0,
(mean_delay + 4*variation)*1000);
fflush(stdout);
-
+#endif
/* if the jitter buffer was exceeded */
if ( diff*1000 > jitter_buff ) {
+#if DEBUG
printf("Packet drop by jitter buffer exceeded\n");
+#endif
rci->drop_by_jitter_buff++;
status = S_DROP_BY_JITT;
/* if there was a silence period (more than two packetization period) resync the source */
if ( (rtp_time - rtp_time_prev) > pack_period*2 ){
+#if DEBUG
printf("Resync...\n");
+#endif
silence_frames = (gint32)((arrive_time - arrive_time_prev)*SAMPLE_RATE - decoded_bytes_prev/2);
for (i = 0; i< silence_frames; i++) {