diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index 9a13205..25096fc 100644
|
a
|
b
|
AvFormatDecoder::AvFormatDecoder(MythPlayer *parent,
|
| 397 | 397 | video_codec_id(kCodec_NONE), |
| 398 | 398 | maxkeyframedist(-1), |
| 399 | 399 | // Closed Caption & Teletext decoders |
| 400 | | ignore_scte(false), |
| | 400 | ignore_scte(0), |
| 401 | 401 | invert_scte_field(0), |
| 402 | 402 | last_scte_field(0), |
| 403 | 403 | ccd608(new CC608Decoder(parent->GetCC608Reader())), |
| … |
… |
bool AvFormatDecoder::ProcessVideoFrame(AVStream *stream, AVFrame *mpa_pic)
|
| 3623 | 3623 | { |
| 3624 | 3624 | AVCodecContext *context = stream->codec; |
| 3625 | 3625 | |
| | 3626 | // We need to mediate between ATSC and SCTE data when both are present. If |
| | 3627 | // both are present, we generally want to prefer ATSC. However, there may |
| | 3628 | // be large sections of the recording where ATSC is used and other sections |
| | 3629 | // where SCTE is used. In that case, we want to allow a natural transition |
| | 3630 | // from ATSC back to SCTE. We do this by allowing 10 consecutive SCTE |
| | 3631 | // frames, without an intervening ATSC frame, to cause a switch back to |
| | 3632 | // considering SCTE frames. The number 10 is somewhat arbitrarily chosen. |
| | 3633 | |
| 3626 | 3634 | uint cc_len = (uint) max(mpa_pic->scte_cc_len,0); |
| 3627 | 3635 | uint8_t *cc_buf = mpa_pic->scte_cc_buf; |
| 3628 | 3636 | bool scte = true; |
| 3629 | 3637 | |
| | 3638 | // If we saw SCTE, then decrement a nonzero ignore_scte count. |
| | 3639 | if (cc_len > 0 && ignore_scte) |
| | 3640 | --ignore_scte; |
| | 3641 | |
| 3630 | 3642 | // If both ATSC and SCTE caption data are available, prefer ATSC |
| 3631 | 3643 | if ((mpa_pic->atsc_cc_len > 0) || ignore_scte) |
| 3632 | 3644 | { |
| 3633 | | ignore_scte = true; |
| 3634 | 3645 | cc_len = (uint) max(mpa_pic->atsc_cc_len, 0); |
| 3635 | 3646 | cc_buf = mpa_pic->atsc_cc_buf; |
| 3636 | 3647 | scte = false; |
| | 3648 | // If we explicitly saw ATSC, then reset ignore_scte count. |
| | 3649 | if (cc_len > 0) |
| | 3650 | ignore_scte = 10; |
| 3637 | 3651 | } |
| 3638 | 3652 | |
| 3639 | 3653 | // Decode CEA-608 and CEA-708 captions |
diff --git a/mythtv/libs/libmythtv/avformatdecoder.h b/mythtv/libs/libmythtv/avformatdecoder.h
index d434f14..46e93d9 100644
|
a
|
b
|
class AvFormatDecoder : public DecoderBase
|
| 330 | 330 | int maxkeyframedist; |
| 331 | 331 | |
| 332 | 332 | // Caption/Subtitle/Teletext decoders |
| 333 | | bool ignore_scte; |
| | 333 | uint ignore_scte; |
| 334 | 334 | uint invert_scte_field; |
| 335 | 335 | uint last_scte_field; |
| 336 | 336 | CC608Decoder *ccd608; |