diff options
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 13 | ||||
-rw-r--r-- | src/input/input_stdin_fifo.c | 37 |
2 files changed, 26 insertions, 24 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index df1242da7..57ae0ab9a 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.84 2002/12/08 21:43:51 miguelfreitas Exp $ + * $Id: demux_mpgaudio.c,v 1.85 2002/12/12 12:00:23 guenter Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -358,10 +358,17 @@ static uint32_t demux_mpgaudio_read_head(input_plugin_t *input) { printf ("demux_mpgaudio: stream is seekable\n"); #endif - } else if (input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW)) { + } else if ((input->get_capabilities(input) & INPUT_CAP_PREVIEW) != 0) { + +#ifdef LOG + printf ("demux_mpgaudio: input plugin provides preview\n"); +#endif + + input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW); head = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; #ifdef LOG - printf ("demux_mpgaudio: got preview\n"); + printf ("demux_mpgaudio: got preview %02x %02x %02x %02x\n", + buf[0], buf[1], buf[2], buf[3]); #endif } else { #ifdef LOG diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index 092c2b7b0..a992b8f1c 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_stdin_fifo.c,v 1.37 2002/11/20 11:57:43 mroi Exp $ + * $Id: input_stdin_fifo.c,v 1.38 2002/12/12 12:00:24 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,10 +32,6 @@ #include <sys/stat.h> #include <errno.h> -#if defined(__linux__) -#include <linux/config.h> /* Check for DEVFS */ -#endif - #include "xine_internal.h" #include "xineutils.h" #include "input_plugin.h" @@ -242,7 +238,8 @@ static void stdin_plugin_dispose (input_plugin_t *this_gen ) { if (this->nbc) nbc_close (this->nbc); - close(this->fh); + if (this->fh != STDIN_FILENO) + close(this->fh); free (this->mrl); free (this); @@ -271,7 +268,6 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea /* stdin_input_class_t *cls = (stdin_input_class_t *) cls_gen; */ stdin_input_plugin_t *this; char *mrl = strdup(data); - char *filename; int fh; @@ -282,30 +278,29 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea if (!strncasecmp(mrl, "stdin:/", 7) || !strncmp(mrl, "-", 1)) { -#if defined(CONFIG_DEVFS_FS) - filename = "/dev/vc/stdin"; -#else - filename = "/dev/stdin"; -#endif + + fh = STDIN_FILENO; } else if (!strncasecmp (mrl, "fifo:/", 6)) { + char *filename; + + fh = open (filename, O_RDONLY); filename = (char *) &mrl[6]; + printf("input_stdin_fifo: filename '%s'\n", filename); + + if (fh == -1) { + printf ("stdin: failed to open '%s'\n", + filename); + free (mrl); + return NULL; + } } else { free (mrl); return NULL; } - printf("input_stdin_fifo: filename '%s'\n", filename); - fh = open (filename, O_RDONLY); - - if (fh == -1) { - printf ("stdin: failed to open '%s'\n", - filename); - free (mrl); - return NULL; - } /* * mrl accepted and opened successfully at this point |