1
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:33:46 +01:00

mp_msg: fix status output disappearing when redirecting INPUT.

Instead, we now check stderr's destination against the foreground tty
for deciding whether we want status output or not.
This commit is contained in:
Rudolf Polzer 2013-03-18 20:33:29 +01:00
parent 3ef58d85ba
commit b1ae33a355
2 changed files with 4 additions and 4 deletions

View File

@ -111,8 +111,8 @@ int mp_msg_test(int mod, int lev)
{
#ifndef __MINGW32__
if (lev == MSGL_STATUS) {
// skip status line output if we are not in the foreground process group
if (tcgetpgrp(0) != getpgrp())
// skip status line output if stderr is not in the fg process group
if (tcgetpgrp(2) != getpgrp())
return false;
}
#endif

View File

@ -340,10 +340,10 @@ void getch2_poll(void){
if (!getch2_enabled)
return;
// check if we are in the foreground process group
// check if stdin is in the foreground process group
int newstatus = (tcgetpgrp(0) == getpgrp());
// and activate getch2 if we are, deactivate otherwise
// and activate getch2 if it is, deactivate otherwise
if (newstatus)
do_activate_getch2();
else