demux: take chapter/attachment name strings without 0-termination
[mplayer/glamo.git] / stream / open.c
blob6a16275fd35c5efad1474aa21254ed74c8c3a76b
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 "libmpdemux/demuxer.h"
23 /// We keep these 2 for the gui atm, but they will be removed.
24 int vcd_track=0;
25 char* cdrom_device=NULL;
26 int dvd_chapter=1;
27 int dvd_last_chapter=0;
28 char* dvd_device=NULL;
29 int dvd_title=0;
31 // Open a new stream (stdin/file/vcd/url)
33 stream_t* open_stream(char* filename, struct MPOpts *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);