Fix:
[mplayer/glamo.git] / libmpdemux / open.c
blob5fcfa5b50811c52acd7d9309966c2f2721ae5071
2 #include <ctype.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <unistd.h>
7 #include <fcntl.h>
8 #include <string.h>
10 #include "config.h"
11 #include "mp_msg.h"
12 #include "help_mp.h"
14 #ifdef __FreeBSD__
15 #include <sys/cdrio.h>
16 #endif
18 #include "m_option.h"
19 #include "stream.h"
20 #include "demuxer.h"
21 #include "mf.h"
24 /// We keep these 2 for the gui atm, but they will be removed.
25 int vcd_track=0;
26 char* cdrom_device=NULL;
27 int dvd_chapter=1;
28 int dvd_last_chapter=0;
29 char* dvd_device=NULL;
30 int dvd_title=0;
32 // Open a new stream (stdin/file/vcd/url)
34 stream_t* open_stream(char* filename,char** options, int* file_format){
35 // Check if playlist or unknown
36 if (*file_format != DEMUXER_TYPE_PLAYLIST){
37 *file_format=DEMUXER_TYPE_UNKNOWN;
40 if(!filename) {
41 mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n");
42 return NULL;
45 //============ Open STDIN or plain FILE ============
47 return open_stream_full(filename,STREAM_READ,options,file_format);