diff options
-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++; + } } } |