Index: mplayer.c =================================================================== --- mplayer.c (revision 19906) +++ mplayer.c (working copy) @@ -295,6 +295,8 @@ static char *stream_dump_name="stream.dump"; int stream_dump_type=0; + char* info_fifo_name=NULL; + // A-V sync: static float default_max_pts_correction=-1;//0.01f; static float max_pts_correction=0;//default_max_pts_correction; @@ -713,6 +715,8 @@ if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,how); mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize); + mp_msg_infofifo_uninit(); + exit(rc); } @@ -2848,6 +2852,8 @@ } } + mp_msg_infofifo_init(); + #if defined(WIN32) && defined(HAVE_NEW_GUI) void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows"); if(runningmplayer && filename && use_gui){ Index: cfg-mplayer.h =================================================================== --- cfg-mplayer.h (revision 19906) +++ cfg-mplayer.h (working copy) @@ -340,6 +340,8 @@ {"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL}, {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"info_fifo", &info_fifo_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + // a-v sync stuff: {"correct-pts", &correct_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"no-correct-pts", &correct_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, Index: mp_msg.c =================================================================== --- mp_msg.c (revision 19906) +++ mp_msg.c (working copy) @@ -5,6 +5,7 @@ #include #include #include +#include #include "config.h" @@ -38,6 +39,9 @@ static iconv_t msgiconv; #endif +extern char* info_fifo_name; +static FILE* info_fifo = NULL; + void mp_msg_init(void){ int i; char *env = getenv("MPLAYER_VERBOSE"); @@ -57,6 +61,21 @@ #endif } +void mp_msg_infofifo_init(void){ + if (info_fifo_name){ + int fifo_fd = open(info_fifo_name, O_RDWR | O_NONBLOCK); + if(fifo_fd >= 0){ + info_fifo = fdopen(fifo_fd, "w"); + } + } +} + +void mp_msg_infofifo_uninit(void){ + if(info_fifo){ + fclose(info_fifo); + } +} + int mp_msg_test(int mod, int lev) { return lev <= (mp_msg_levels[mod] == -2 ? mp_msg_level_all + verbose : mp_msg_levels[mod]); @@ -186,6 +205,10 @@ ||tmp[strlen(tmp)-1] == '\r'; } #endif + if(info_fifo){ + fprintf(info_fifo, "%s", tmp); + fflush(info_fifo); + } if (lev <= MSGL_WARN){ fprintf(stderr, "%s", tmp);fflush(stderr); } else {