diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-02-10 15:01:02 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-02-10 20:26:21 +0000 |
commit | 8186ab3d9f8054478e99f5e707ddf798809a96ee (patch) | |
tree | 87127653cd4abb5846a1137ef35ffe280c3f65fb /ui | |
parent | dae11790e72d56e15136ff0b5902cd7577d6add4 (diff) |
Qt: fix jitter buffer management
Small bugs were introduced when copy/pasting the code from GTK UI:
- arrive_offset is stored in seconds and not milliseconds
- some tests regarding the current playback mode were wrong
Change-Id: I21fb82ba8ff6c8defa7df90c815c040e9e074aaa
Reviewed-on: https://code.wireshark.org/review/13885
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/rtp_audio_stream.cpp | 8 | ||||
-rw-r--r-- | ui/rtp_media.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp index 5cfba191e8..65cb0865e7 100644 --- a/ui/qt/rtp_audio_stream.cpp +++ b/ui/qt/rtp_audio_stream.cpp @@ -250,14 +250,14 @@ void RtpAudioStream::decode() double rtp_time = (double)(rtp_packet->info->info_timestamp-start_timestamp)/sample_rate - start_rtp_time; double arrive_time; - if (timing_mode_ == Uninterrupted) { + if (timing_mode_ == RtpTimestamp) { arrive_time = rtp_time; } else { - arrive_time = (double)rtp_packet->arrive_offset/1000 - start_time; + arrive_time = rtp_packet->arrive_offset - start_time; } double diff = qAbs(arrive_time - rtp_time); - if (diff*1000 > jitter_buffer_size_ && timing_mode_ == Uninterrupted) { + if (diff*1000 > jitter_buffer_size_ && timing_mode_ != Uninterrupted) { // rtp_player.c:628 jitter_drop_timestamps_.append(stop_rel_time_); @@ -281,7 +281,7 @@ void RtpAudioStream::decode() /* XXX: if timestamps (RTP) are missing/ignored try use packet arrive time only (see also "rtp_time") */ start_timestamp = rtp_packet->info->info_timestamp; start_rtp_time = 0; - start_time = (double)rtp_packet->arrive_offset/1000; + start_time = rtp_packet->arrive_offset; rtp_time_prev = 0; } diff --git a/ui/rtp_media.h b/ui/rtp_media.h index 5432091805..222be304b9 100644 --- a/ui/rtp_media.h +++ b/ui/rtp_media.h @@ -50,7 +50,7 @@ typedef gint16 SAMPLE; typedef struct _rtp_packet { guint32 frame_num; /* Qt only */ struct _rtp_info *info; /* the RTP dissected info */ - double arrive_offset; /* arrive offset time since the beginning of the stream in ms */ + double arrive_offset; /* arrive offset time since the beginning of the stream as ms in GTK UI and s in Qt UI */ guint8* payload_data; } rtp_packet_t; |