diff options
author | Ron Economos <w6rz@comcast.net> | 2020-02-07 01:02:50 -0800 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-02-08 15:17:14 +0100 |
commit | e33d782f5dff49400295bad4324fdef67ec67a3b (patch) | |
tree | 458a0338ddc3004ecab7b76f7cba1bd7339217e8 /gr-dtv | |
parent | 8be48325fbe18b90ccb6447e6fdb7546b98d2966 (diff) |
gr-dtv: Detect missing data field syncs and reset pipeline.
Diffstat (limited to 'gr-dtv')
-rw-r--r-- | gr-dtv/lib/atsc/atsc_fs_checker_impl.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc index c881068ee1..838b60cb73 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2014 Free Software Foundation, Inc. + * Copyright 2014,2020 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,6 +19,8 @@ #include "gnuradio/dtv/atsc_consts.h" #include <gnuradio/io_signature.h> +#define ATSC_SEGMENTS_PER_DATA_FIELD 313 + static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong static const int PN63_ERROR_LIMIT = 5; @@ -97,7 +99,12 @@ int atsc_fs_checker_impl::general_work(int noutput_items, out[output_produced].data[j] = in[i].data[j]; out[output_produced].pli.set_regular_seg((d_field_num == 2), d_segment_num); d_segment_num++; - output_produced++; + if (d_segment_num > (ATSC_SEGMENTS_PER_DATA_FIELD - 1)) { + d_field_num = 0; + d_segment_num = 0; + } else { + output_produced++; + } } } |