Qt: write number of decoded bytes in the RTP player temporary buffer
authorPascal Quantin <pascal.quantin@gmail.com>
Tue, 1 Dec 2015 18:23:32 +0000 (19:23 +0100)
committerPascal Quantin <pascal.quantin@gmail.com>
Tue, 1 Dec 2015 21:24:42 +0000 (21:24 +0000)
For codecs using compression (so not G.711) the number of decoded bytes is different from payload len * sample bytes.
This result in a truncated audio buffer and inaudible audio.

Change-Id: I755c19df37820c1c56acc7bd7b67fcc104516474
Reviewed-on: https://code.wireshark.org/review/12336
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
ui/qt/rtp_audio_stream.cpp

index 99381e6509e5c01bf35d8b13d31ef6692429f434..a8f4c02011b226701e0c9a9fb4dda7145ac44a38 100644 (file)
@@ -319,7 +319,7 @@ void RtpAudioStream::decode()
 
         // Write samples to our file.
         write_buff = (char *) decode_buff;
-        write_bytes = rtp_packet->info->info_payload_len * sample_bytes_;
+        write_bytes = decoded_bytes;
 
         if (audio_out_rate_ != sample_rate) {
             // Resample the audio to match our previous output rate.