forked from osmocom/wireshark
RTP: rtp_audio_stream.cpp: fixed excess silence in visualisation on waveform
When silence is inserted to waveform (VaD, no RTP, ...), waveform is shifted to correct time in visualisation. Code was inserting silence to audio waveform too therefore following audio was shifted twice. This patch fixes it. Change-Id: I4f3e02328662f92b1dabec80ce9da31d0a839046 Reviewed-on: https://code.wireshark.org/review/34917 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
6fd51d5b25
commit
c0cec58564
|
@ -614,8 +614,10 @@ void RtpAudioStream::writeSilence(int samples)
|
|||
tempfile_->write(silence_buff, silence_bytes);
|
||||
g_free(silence_buff);
|
||||
|
||||
QVector<qint16> visual_fill(samples * visual_sample_rate_ / audio_out_rate_, 0);
|
||||
visual_samples_ += visual_fill;
|
||||
// Silence is inserted to audio file only.
|
||||
// If inserted to visual_samples_ too, it shifts whole waveset
|
||||
//QVector<qint16> visual_fill(samples * visual_sample_rate_ / audio_out_rate_, 0);
|
||||
//visual_samples_ += visual_fill;
|
||||
}
|
||||
|
||||
void RtpAudioStream::outputStateChanged(QAudio::State new_state)
|
||||
|
|
|
@ -275,7 +275,7 @@ void RtpPlayerDialog::rescanPackets(bool rescale_axes)
|
|||
audio_graph->setData(audio_stream->visualTimestamps(relative_timestamps), audio_stream->visualSamples(y_offset));
|
||||
audio_graph->removeFromLegend();
|
||||
ti->setData(graph_data_col_, Qt::UserRole, QVariant::fromValue<QCPGraph *>(audio_graph));
|
||||
RTP_STREAM_DEBUG("Plotting %s, %d samples", ti->text(src_addr_col_).toUtf8().constData(), audio_graph->data()->keys().length());
|
||||
RTP_STREAM_DEBUG("Plotting %s, %d samples", ti->text(src_addr_col_).toUtf8().constData(), audio_graph->data()->size());
|
||||
|
||||
QString span_str = QString("%1 - %2 (%3)")
|
||||
.arg(QString::number(audio_stream->startRelTime(), 'g', 3))
|
||||
|
|
Loading…
Reference in New Issue