summaryrefslogtreecommitdiff
path: root/src/input/input_stdin_fifo.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-12-12 12:00:23 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-12-12 12:00:23 +0000
commit230c914155ce1e3a3164005bbcb5c4644272e1be (patch)
tree6edea976421e845237c827a0e720c565982f17ae /src/input/input_stdin_fifo.c
parent83c217b4f8c8f0fab46e86a86ca694852aa049fb (diff)
downloadxine-lib-230c914155ce1e3a3164005bbcb5c4644272e1be.tar.gz
xine-lib-230c914155ce1e3a3164005bbcb5c4644272e1be.tar.bz2
fix stdin plugin, cosmetic cleanups in mp3 demuxer
CVS patchset: 3493 CVS date: 2002/12/12 12:00:23
Diffstat (limited to 'src/input/input_stdin_fifo.c')
-rw-r--r--src/input/input_stdin_fifo.c37
1 files changed, 16 insertions, 21 deletions
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