Fix errors in audio_p25_rx.py

git-svn-id: http://op25.osmocom.org/svn/trunk@263 65a5c917-d112-43f1-993d-58c26a4786be
This commit is contained in:
stevie 2011-01-28 04:26:57 +00:00
parent 56c20eeb6f
commit 8ee7040a76
2 changed files with 2 additions and 5 deletions

View File

@ -105,13 +105,11 @@ op25_pcap_source::read_at_least(const size_t NSYMS_REQD)
while(pcap_ && n < NSYMS_REQD) {
const uint8_t *octets = pcap_next(pcap_, &hdr);
if(octets) {
// push inter-frame silence symbols
const float N = (prev_is_present_ ? ifs(hdr, prev_, ETHERNET_SZ) : DELAY_);
const uint_least32_t NSYMS = roundl(N * (1 / SYMBOLS_PER_SEC_));
for(uint_least32_t i = 0; i < NSYMS; ++i, ++n) {
symbols_.push_back(0);
}
// push symbols from frame payload
for(size_t i = ETHERNET_SZ; i < hdr.caplen; ++i, ++n) {
for(int16_t j = 6; j >= 0; j -= 2) {
dibit d = (octets[i] >> j) & 0x3;
@ -124,7 +122,6 @@ op25_pcap_source::read_at_least(const size_t NSYMS_REQD)
pcap_close(pcap_);
pcap_ = NULL;
if(repeat_) {
// re-open the file
char err[PCAP_ERRBUF_SIZE];
pcap_ = pcap_open_offline(path_.c_str(), err);
prev_is_present_ = false;

View File

@ -293,8 +293,8 @@ class p25_rx_block (stdgui2.std_top_block):
self.traffic = TrafficPane(self.notebook)
self.notebook.AddPage(self.traffic, "Traffic")
# Setup the decoder and report the TUN/TAP device name
self.decode_watcher = decode_watcher(msgq, self.traffic)
self.p25_decoder = op25.decoder_ff()
self.decode_watcher = decode_watcher(self.msgq, self.traffic)
self.p25_decoder = op25.decoder_bf()
self.p25_decoder.set_msgq(gr.msg_queue(2))
self.frame.SetStatusText("TUN/TAP: " + self.p25_decoder.device_name())