aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2015-04-13 20:22:25 +0100
committerDave Chapman <dave@dchapman.com>2015-04-13 20:22:25 +0100
commit95afa6b436b6b0edfd4f21f535208f237194aa92 (patch)
tree742f10eb5e62c588923637c3423d2b90d16b49e2
parent320ba6c22da9b7c06cbf4e6ec2cc183fcc27d9f0 (diff)
downloadetisnoop-95afa6b436b6b0edfd4f21f535208f237194aa92.tar.gz
etisnoop-95afa6b436b6b0edfd4f21f535208f237194aa92.tar.bz2
etisnoop-95afa6b436b6b0edfd4f21f535208f237194aa92.zip
Some bug fixes in the FIG parser.
-rw-r--r--etisnoop.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/etisnoop.cpp b/etisnoop.cpp
index 902d6c8..ce69746 100644
--- a/etisnoop.cpp
+++ b/etisnoop.cpp
@@ -456,7 +456,7 @@ int eti_analyse(eti_analyse_config_t& config)
if ((tpl & 0x20) >> 5 == 1) {
unsigned char opt, plevel;
string plevelstr;
- opt = (tpl & 0x16) >> 2;
+ opt = (tpl & 0x1c) >> 2;
plevel = (tpl & 0x03);
if (opt == 0x00) {
if (plevel == 0)
@@ -713,14 +713,14 @@ void decodeFIG(FIGalyser &figs,
while (i < figlen-3) {
// iterate over subchannels
int subch_id = f[i] >> 2;
- int start_addr = (f[i] << 6) |
+ int start_addr = ((f[i] & 0x03) << 8) |
(f[i+1]);
int long_flag = (f[i+2] >> 7);
if (long_flag) {
int option = (f[i+2] >> 4) & 0x07;
int protection_level = (f[i+2] >> 2) & 0x03;
- int subchannel_size = ((f[i+2] & 0x03) << 6 ) |
+ int subchannel_size = ((f[i+2] & 0x03) << 8 ) |
f[i+3];
i += 4;
@@ -763,6 +763,7 @@ void decodeFIG(FIGalyser &figs,
}
}
+ break;
case 2: // FIG 0/2
{
unsigned short int sref, sid;