CCExtractor / ccextractor

CCExtractor - Official version maintained by the core team
https://www.ccextractor.org
GNU General Public License v2.0
715 stars 425 forks source link

ctrl-c not working in linux #661

Closed cfsmp3 closed 7 years ago

cfsmp3 commented 7 years ago

ctrl-c (sigint) is not working on the linux version, which is quite annoying.

Izaron commented 7 years ago

After removing this line all is OK - https://github.com/CCExtractor/ccextractor/blob/master/src/ccextractor.c#L154 But don't sure if we should just remove this line without understanding.

saurabhshri commented 7 years ago

@Izaron Instead of deleting it, I think it will be better to appropriately handle it. For example, if we want to terminate it ASAP on receiving SIGINT, we can do this -> (https://github.com/CCExtractor/ccextractor/compare/master...saurabhshri:patch-2).

@cfsmp3 Please have a look at the above commit. Does this seem okay to you?

Edit : Here's how it looks. Whatever action you would recommend, we will write instead of terminate_asap = 1; :

NOW


./ccextractor -
CCExtractor 0.85, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc
--------------------------------------------------------------------------
Input: stdin
[Extract: 1] [Stream mode: Autodetect]
[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto]
[Timing mode: Auto] [Debug: No] [Buffer input: No]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: Yes] [Add font typesetting: Yes]
[Convert case: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: Yes, no timeout] [Clock frequency: 90000]
[Teletext page: Autodetect]
[Start credits text: None]

-----------------------------------------------------------------
Reading from standard input
^CCaught SIGINT. Terminating ASAP.

File seems to be an elementary stream, enabling ES mode
Analyzing data in general mode
Done, processing time = 6 seconds
Issues? Open a ticket here
https://github.com/CCExtractor/ccextractor/issues
No captions were found in input.

PREV

./ccextractor -
CCExtractor 0.84, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc
--------------------------------------------------------------------------
Input: stdin
[Extract: 1] [Stream mode: Autodetect]
[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto]
[Timing mode: Auto] [Debug: No] [Buffer input: No]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: Yes] [Add font typesetting: Yes]
[Convert case: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: Yes, no timeout] [Clock frequency: 90000]
[Teletext page: Autodetect]
[Start credits text: None]

-----------------------------------------------------------------
Reading from standard input
^C

^C

^C^C^C
^Z
[11]+  Stopped                 ./ccextractor -
cfsmp3 commented 7 years ago

Both solutions are OK. The problem is that we're mixing different (and incompatible) ways to setup handlers. I've solved it by having 3 handlers that are setup in the same way.