From d2bea3802e14994297b6d28e3093d1a667de2ef3 Mon Sep 17 00:00:00 2001 From: Amey Jain Date: Mon, 20 Mar 2017 14:03:41 +0530 Subject: [PATCH 01/14] In ref. to issue 699. 20 ms timing mis-match. modified: src/lib_ccx/general_loop.c modified: src/lib_ccx/telxcc.c --- src/lib_ccx/general_loop.c | 8 +++++--- src/lib_ccx/telxcc.c | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib_ccx/general_loop.c b/src/lib_ccx/general_loop.c index f77e162b..527591f1 100644 --- a/src/lib_ccx/general_loop.c +++ b/src/lib_ccx/general_loop.c @@ -1102,7 +1102,7 @@ int rcwt_loop(struct lib_ccx_ctx *ctx) int caps = 0; LLONG result; struct encoder_ctx *enc_ctx = update_encoder_list(ctx); - + struct Teletext *telctx; // As BUFSIZE is a macro this is just a reminder if (BUFSIZE < (3*0xFFFF + 10)) fatal (CCX_COMMON_EXIT_BUG_BUG, "BUFSIZE too small for RCWT caption block.\n"); @@ -1143,6 +1143,7 @@ int rcwt_loop(struct lib_ccx_ctx *ctx) dec_ctx->private_data = telxcc_init(); } dec_sub = &dec_ctx->dec_sub; + telctx =dec_ctx->private_data; /* Set minimum and current pts since rcwt has correct time */ dec_ctx->timing->min_pts = 0; @@ -1155,9 +1156,10 @@ int rcwt_loop(struct lib_ccx_ctx *ctx) { result = buffered_read(ctx->demux_ctx, buf, TELETEXT_CHUNK_LEN); ctx->demux_ctx->past += result; - if (result != TELETEXT_CHUNK_LEN) + if (result != TELETEXT_CHUNK_LEN){ + telxcc_dump_prev_page(telctx,dec_sub); break; - + } tlt_read_rcwt(dec_ctx->private_data, buf, dec_sub); if(dec_sub->got_output == CCX_TRUE) { diff --git a/src/lib_ccx/telxcc.c b/src/lib_ccx/telxcc.c index 9f3b979e..85414787 100644 --- a/src/lib_ccx/telxcc.c +++ b/src/lib_ccx/telxcc.c @@ -1002,18 +1002,19 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->transmission_mode = (transmission_mode_t) (unham_8_4(packet->data[7]) & 0x01); // FIXME: Well, this is not ETS 300 706 kosher, however we are interested in DATA_UNIT_EBU_TELETEXT_SUBTITLE only - if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE)) return; + if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE)/* && (ctx->page_buffer.tainted == NO)*/) return; if ((ctx->receiving_data == YES) && ( ((ctx->transmission_mode == TRANSMISSION_MODE_SERIAL) && (PAGE(page_number) != PAGE(tlt_config.page))) || ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (PAGE(page_number) != PAGE(tlt_config.page)) && (m == MAGAZINE(tlt_config.page))))) { ctx->receiving_data = NO; - return; + if(ctx->page_buffer.tainted == NO) + return; } // Page transmission is terminated, however now we are waiting for our new page - if (page_number != tlt_config.page) + if (page_number != tlt_config.page && ctx->page_buffer.tainted == NO) return; From 094a8f295a91e919ab58573cfb5e3afacd91e06c Mon Sep 17 00:00:00 2001 From: Amey Jain Date: Tue, 21 Mar 2017 01:06:00 +0530 Subject: [PATCH 02/14] Issue 699 solved. --- src/lib_ccx/telxcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_ccx/telxcc.c b/src/lib_ccx/telxcc.c index 85414787..632bd1b3 100644 --- a/src/lib_ccx/telxcc.c +++ b/src/lib_ccx/telxcc.c @@ -1002,7 +1002,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->transmission_mode = (transmission_mode_t) (unham_8_4(packet->data[7]) & 0x01); // FIXME: Well, this is not ETS 300 706 kosher, however we are interested in DATA_UNIT_EBU_TELETEXT_SUBTITLE only - if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE)/* && (ctx->page_buffer.tainted == NO)*/) return; + if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE) && (ctx->page_buffer.tainted == NO)) return; if ((ctx->receiving_data == YES) && ( ((ctx->transmission_mode == TRANSMISSION_MODE_SERIAL) && (PAGE(page_number) != PAGE(tlt_config.page))) || From ab5544691a0e0dba07c424fc01626b01f6b01d14 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Wed, 29 Mar 2017 19:52:22 +0530 Subject: [PATCH 03/14] Initial commit --- package_creators/PKGBUILD | 22 ++++++++++++++++++++++ package_creators/arch.sh | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 package_creators/PKGBUILD create mode 100755 package_creators/arch.sh diff --git a/package_creators/PKGBUILD b/package_creators/PKGBUILD new file mode 100644 index 00000000..4bc1e96f --- /dev/null +++ b/package_creators/PKGBUILD @@ -0,0 +1,22 @@ +pkgname=ccextractor +pkgver=0.85 +pkgrel=1 +pkgdesc="A closed captions and teletext subtitles extractor for video streams." +arch=('i686' 'x86_64') +url="http://www.ccextractor.org" +license=('GPL') +depends=('gcc-libs' 'tesseract') +source=( + $pkgname-$pkgver.tar.gz +) + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./configure --prefix="$pkgdir/usr/local" --CC=gcc + make -j4 +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make install +} diff --git a/package_creators/arch.sh b/package_creators/arch.sh new file mode 100755 index 00000000..3db15a25 --- /dev/null +++ b/package_creators/arch.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +./tarball.sh +makepkg -g >> PKGBUILD +makepkg -sic +rm ./*.tar.gz +rm ./*.pkg.tar.xz +sed -i '$ d' PKGBUILD From 236840919d249d287b9b34f026b7c274cb7c4640 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Thu, 30 Mar 2017 11:24:55 +0530 Subject: [PATCH 04/14] Use gcc as the C compiler during configure --- package_creators/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_creators/PKGBUILD b/package_creators/PKGBUILD index 4bc1e96f..8f319095 100644 --- a/package_creators/PKGBUILD +++ b/package_creators/PKGBUILD @@ -12,7 +12,7 @@ source=( build() { cd "$srcdir/$pkgname-$pkgver" - ./configure --prefix="$pkgdir/usr/local" --CC=gcc + CC=gcc ./configure --prefix="$pkgdir/usr/local" make -j4 } From 8878aebe0bf95877729d4da5be6e5b76f85bb2fc Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Thu, 30 Mar 2017 11:25:41 +0530 Subject: [PATCH 05/14] Allow option to build .pkg.tar.xz archive without installing package --- package_creators/arch.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package_creators/arch.sh b/package_creators/arch.sh index 3db15a25..d19eaa21 100755 --- a/package_creators/arch.sh +++ b/package_creators/arch.sh @@ -2,7 +2,11 @@ ./tarball.sh makepkg -g >> PKGBUILD -makepkg -sic -rm ./*.tar.gz -rm ./*.pkg.tar.xz +makepkg -sc +rm -f ./*.tar.gz sed -i '$ d' PKGBUILD +read -p "Do you wish to install ccextractor? [Y/n] " yn +case $yn in + [Nn]* ) exit;; + * ) sudo pacman -U ./*.pkg.tar.xz; rm -f ./*.pkg.tar.xz;; +esac From 4c73649b9c621e346927f992afff9939d65eb360 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Thu, 30 Mar 2017 11:42:15 +0530 Subject: [PATCH 06/14] Add --enable-ocr as a configure option by default --- package_creators/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_creators/PKGBUILD b/package_creators/PKGBUILD index 8f319095..05ef2601 100644 --- a/package_creators/PKGBUILD +++ b/package_creators/PKGBUILD @@ -12,7 +12,7 @@ source=( build() { cd "$srcdir/$pkgname-$pkgver" - CC=gcc ./configure --prefix="$pkgdir/usr/local" + CC=gcc ./configure --enable-ocr --prefix="$pkgdir/usr/local" make -j4 } From 1b3598b2fe0cf4fca860f572900ec2d386d59d6b Mon Sep 17 00:00:00 2001 From: Amey Jain Date: Sat, 8 Apr 2017 08:34:18 +0530 Subject: [PATCH 07/14] Timing mis-match corrected. --- src/lib_ccx/lib_ccx.c | 2 +- src/lib_ccx/telxcc.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib_ccx/lib_ccx.c b/src/lib_ccx/lib_ccx.c index a7e8c680..192e8697 100644 --- a/src/lib_ccx/lib_ccx.c +++ b/src/lib_ccx/lib_ccx.c @@ -215,7 +215,7 @@ void dinit_libraries( struct lib_ccx_ctx **ctx) dvbsub_close_decoder(&dec_ctx->private_data); //Test memory for teletext else if (dec_ctx->codec == CCX_CODEC_TELETEXT) - telxcc_close(&dec_ctx->private_data, NULL); + telxcc_close(&dec_ctx->private_data, &dec_ctx->dec_sub); else if (dec_ctx->codec == CCX_CODEC_ISDB_CC) delete_isdb_decoder(&dec_ctx->private_data); diff --git a/src/lib_ccx/telxcc.c b/src/lib_ccx/telxcc.c index 632bd1b3..c77ce9a8 100644 --- a/src/lib_ccx/telxcc.c +++ b/src/lib_ccx/telxcc.c @@ -50,7 +50,7 @@ int _CRT_fmode = _O_BINARY; #endif long long int last_pes_pts = 0; // PTS of last PES packet (debug purposes) - +int de_ctr = 0; // a keeps count of packets with flag subtitle ON and data packets typedef struct { uint64_t show_timestamp; // show at timestamp (in ms) uint64_t hide_timestamp; // hide at timestamp (in ms) @@ -978,11 +978,13 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->seen_sub_page[thisp]=1; mprint ("\rNotice: Teletext page with possible subtitles detected: %03d\n",thisp); } + ++de_ctr; } if ((tlt_config.page == 0) && (flag_subtitle == YES) && (i < 0xff)) { tlt_config.page = (m << 8) | (unham_8_4(packet->data[1]) << 4) | unham_8_4(packet->data[0]); mprint ("- No teletext page specified, first received suitable page is %03x, not guaranteed\n", tlt_config.page); + ++de_ctr; } // Page number and control bits @@ -1002,19 +1004,19 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->transmission_mode = (transmission_mode_t) (unham_8_4(packet->data[7]) & 0x01); // FIXME: Well, this is not ETS 300 706 kosher, however we are interested in DATA_UNIT_EBU_TELETEXT_SUBTITLE only - if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE) && (ctx->page_buffer.tainted == NO)) return; + if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE) && !(de_ctr && flag_subtitle)) return; if ((ctx->receiving_data == YES) && ( ((ctx->transmission_mode == TRANSMISSION_MODE_SERIAL) && (PAGE(page_number) != PAGE(tlt_config.page))) || ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (PAGE(page_number) != PAGE(tlt_config.page)) && (m == MAGAZINE(tlt_config.page))))) { ctx->receiving_data = NO; - if(ctx->page_buffer.tainted == NO) + if(!(de_ctr && flag_subtitle)) return; } // Page transmission is terminated, however now we are waiting for our new page - if (page_number != tlt_config.page && ctx->page_buffer.tainted == NO) + if (page_number != tlt_config.page && !(de_ctr && flag_subtitle)) return; @@ -1037,6 +1039,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->page_buffer.hide_timestamp = 0; } process_page(ctx, &ctx->page_buffer, sub); + de_ctr = 0; } ctx->page_buffer.show_timestamp = timestamp; @@ -1073,6 +1076,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->page_buffer.text[y][i] = packet->data[i]; } ctx->page_buffer.tainted = YES; + --de_ctr; } else if ((m == MAGAZINE(tlt_config.page)) && (y == 26) && (ctx->receiving_data == YES)) { From 96ca325a258fbe2d2db5265578f42d17fe73c436 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 11:46:15 +0530 Subject: [PATCH 08/14] Use bash as shell; su instead of sudo; don't proceed if a command fails; change default to not installing --- package_creators/arch.sh | 21 +++++++++++++++++---- package_creators/tarball.sh | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/package_creators/arch.sh b/package_creators/arch.sh index d19eaa21..4b927f5e 100755 --- a/package_creators/arch.sh +++ b/package_creators/arch.sh @@ -1,12 +1,25 @@ -#!/bin/sh +#!/bin/bash ./tarball.sh +retval=$? +if [ $retval -ne 0 ]; then + echo "Sorry, the package could not be created as the tarball building process failed with return code $retval" + rm -f ./*.tar.gz + exit $retval +fi makepkg -g >> PKGBUILD makepkg -sc +retval=$? +if [ $retval -ne 0 ]; then + echo "Sorry, the package could not be created as the makepkg failed with return code $retval" + rm -rf ./*.tar.gz src + sed -i '$ d' PKGBUILD + exit $retval +fi rm -f ./*.tar.gz sed -i '$ d' PKGBUILD -read -p "Do you wish to install ccextractor? [Y/n] " yn +read -p "Do you wish to install ccextractor? [y/N] " yn case $yn in - [Nn]* ) exit;; - * ) sudo pacman -U ./*.pkg.tar.xz; rm -f ./*.pkg.tar.xz;; + [Yy]* ) su -c "pacman -U ./*.pkg.tar.xz"; rm -f ./*.pkg.tar.xz;; + * ) exit;; esac diff --git a/package_creators/tarball.sh b/package_creators/tarball.sh index e949911b..113ce340 100755 --- a/package_creators/tarball.sh +++ b/package_creators/tarball.sh @@ -27,4 +27,4 @@ rm -rf config.log rm -rf aclocal.m4 rm -rf build-conf rm -rf autom4te.cache -cd package_creators \ No newline at end of file +cd package_creators From d3946450ebc89184549fd500d7e5771b6e9aa546 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 11:50:57 +0530 Subject: [PATCH 09/14] Fix small grammatical mistake --- package_creators/arch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_creators/arch.sh b/package_creators/arch.sh index 4b927f5e..366a9663 100755 --- a/package_creators/arch.sh +++ b/package_creators/arch.sh @@ -11,7 +11,7 @@ makepkg -g >> PKGBUILD makepkg -sc retval=$? if [ $retval -ne 0 ]; then - echo "Sorry, the package could not be created as the makepkg failed with return code $retval" + echo "Sorry, the package could not be created as makepkg failed with return code $retval" rm -rf ./*.tar.gz src sed -i '$ d' PKGBUILD exit $retval From 27311f53e6986a1ce597f8d403a2e52edb191ca9 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 17:30:34 +0530 Subject: [PATCH 10/14] Use sudo when available; fallback to su --- package_creators/arch.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package_creators/arch.sh b/package_creators/arch.sh index 366a9663..d8e0cd75 100755 --- a/package_creators/arch.sh +++ b/package_creators/arch.sh @@ -20,6 +20,11 @@ rm -f ./*.tar.gz sed -i '$ d' PKGBUILD read -p "Do you wish to install ccextractor? [y/N] " yn case $yn in - [Yy]* ) su -c "pacman -U ./*.pkg.tar.xz"; rm -f ./*.pkg.tar.xz;; + [Yy]* ) if [ -x "$(command -v sudo)" ]; then + sudo pacman -U ./*.pkg.tar.xz; + else + su -c "pacman -U ./*.pkg.tar.xz"; + fi + rm -f ./*.pkg.tar.xz;; * ) exit;; esac From 83704e306fef4f1696a1678a2dbb9879bd027d6a Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 17:33:29 +0530 Subject: [PATCH 11/14] Update gitignore for pkg.tar.xz files --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index aad1229a..c4ddd6d3 100644 --- a/.gitignore +++ b/.gitignore @@ -91,4 +91,7 @@ src/utf8proc/.dirstamp src/zlib/.deps/ src/zlib/.dirstamp src/zvbi/.deps/ -src/zvbi/.dirstamp \ No newline at end of file +src/zvbi/.dirstamp + +# Arch +package_creators/*.pkg.tar.xz From 58f7345b4283ad0562768b33ac9dec09bf5e389a Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 17:37:59 +0530 Subject: [PATCH 12/14] Update CHANGES.TXT --- docs/CHANGES.TXT | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 2a29c066..1ef7dfda 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -2,6 +2,7 @@ ----------------- - Fix: Prevent the OCR being initialized more than once (happened on multiprogram and PAT changes) +- New: Added build/installation script for .pkg.tar.xz (Arch Linux). 0.85b (2017-1-26) From fddede57fd170bf063d50abac365307dc3220bf6 Mon Sep 17 00:00:00 2001 From: Abhinav Baid Date: Mon, 10 Apr 2017 17:47:54 +0530 Subject: [PATCH 13/14] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 870816fc..6c2a18fc 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,16 @@ More usage information can be found on our website: # test your build ./ccextractor +### Arch Linux + # make sure you have CCExtractor repository forked + # clone repository + sudo pacman -S git + git clone https://github.com/%USERNAME%/ccextractor.git # paste your github username + + # building installation package (.pkg.tar.xz) or installing directly + cd ccextractor/package_creators + ./arch.sh + ### Windows Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it. Configurations "(Debug|Release)-Full" includes dependent libraries which are used for OCR. From 1513b7c42f2fe08e64a9d537c46889b81d852f8d Mon Sep 17 00:00:00 2001 From: Amey Jain Date: Tue, 11 Apr 2017 10:44:44 +0530 Subject: [PATCH 14/14] Timing for sample #70 corrected. --- src/lib_ccx/telxcc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib_ccx/telxcc.c b/src/lib_ccx/telxcc.c index c77ce9a8..316530ec 100644 --- a/src/lib_ccx/telxcc.c +++ b/src/lib_ccx/telxcc.c @@ -50,7 +50,7 @@ int _CRT_fmode = _O_BINARY; #endif long long int last_pes_pts = 0; // PTS of last PES packet (debug purposes) -int de_ctr = 0; // a keeps count of packets with flag subtitle ON and data packets +static int de_ctr = 0; // a keeps count of packets with flag subtitle ON and data packets typedef struct { uint64_t show_timestamp; // show at timestamp (in ms) uint64_t hide_timestamp; // hide at timestamp (in ms) @@ -955,7 +955,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele if (m == 0) m = 8; y = (address >> 3) & 0x1f; designation_code = (y > 25) ? unham_8_4(packet->data[0]) : 0x00; - + uint8_t flag_subtitle; if (y == 0) { @@ -978,14 +978,12 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->seen_sub_page[thisp]=1; mprint ("\rNotice: Teletext page with possible subtitles detected: %03d\n",thisp); } - ++de_ctr; } if ((tlt_config.page == 0) && (flag_subtitle == YES) && (i < 0xff)) { tlt_config.page = (m << 8) | (unham_8_4(packet->data[1]) << 4) | unham_8_4(packet->data[0]); mprint ("- No teletext page specified, first received suitable page is %03x, not guaranteed\n", tlt_config.page); - ++de_ctr; - } + } // Page number and control bits page_number = (m << 8) | (unham_8_4(packet->data[1]) << 4) | unham_8_4(packet->data[0]); @@ -1004,7 +1002,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->transmission_mode = (transmission_mode_t) (unham_8_4(packet->data[7]) & 0x01); // FIXME: Well, this is not ETS 300 706 kosher, however we are interested in DATA_UNIT_EBU_TELETEXT_SUBTITLE only - if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE) && !(de_ctr && flag_subtitle)) return; + if ((ctx->transmission_mode == TRANSMISSION_MODE_PARALLEL) && (data_unit_id != DATA_UNIT_EBU_TELETEXT_SUBTITLE) && !(de_ctr && flag_subtitle && ctx->receiving_data == YES)) return; if ((ctx->receiving_data == YES) && ( ((ctx->transmission_mode == TRANSMISSION_MODE_SERIAL) && (PAGE(page_number) != PAGE(tlt_config.page))) || @@ -1016,7 +1014,7 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele } // Page transmission is terminated, however now we are waiting for our new page - if (page_number != tlt_config.page && !(de_ctr && flag_subtitle)) + if (page_number != tlt_config.page && !(de_ctr && flag_subtitle && ctx->receiving_data == YES)) return;