[FFmpeg-devel] [PATCH 1/2] ffmpeg: don't reconfigure terminal if we're not taking input from stdin
Nicolas George
george at nsup.org
Thu Sep 8 15:49:14 EEST 2016
Le duodi 22 fructidor, an CCXXIV, Rodger Combs a écrit :
> ---
> ffmpeg.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/ffmpeg.c b/ffmpeg.c
> index d858407..1d793fe 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -366,7 +366,7 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
> void term_init(void)
> {
> #if HAVE_TERMIOS_H
> - if(!run_as_daemon){
> + if (!run_as_daemon && stdin_interaction) {
> struct termios tty;
> if (tcgetattr (0, &tty) == 0) {
> oldtty = tty;
> @@ -4328,6 +4328,10 @@ int main(int argc, char **argv)
>
> show_banner(argc, argv, options);
>
> + ret = locate_option(argc, argv, options, "stdin");
> + if (ret && !strcmp(argv[ret], "-nostdin"))
> + stdin_interaction = 0;
> +
> term_init();
I think it would be more elegant to move the term_init() call a few lines
down, after ffmpeg_parse_options(), rather than parse -nostdin out of order.
Apart from that, both patches looks right to me.
>
> /* parse options and open all input/output files */
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160908/9c232a3b/attachment.sig>
More information about the ffmpeg-devel
mailing list