2001-08-09 01:17:24 +00:00
|
|
|
|
2002-01-24 23:02:59 +00:00
|
|
|
#include <ctype.h>
|
2001-08-09 01:17:24 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
2003-03-30 17:07:31 +00:00
|
|
|
#include <string.h>
|
2001-08-09 01:17:24 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
2001-08-17 00:40:25 +00:00
|
|
|
#include "mp_msg.h"
|
2001-08-18 20:32:09 +00:00
|
|
|
#include "help_mp.h"
|
2001-08-09 01:17:24 +00:00
|
|
|
|
2001-08-09 15:47:40 +00:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
#include <sys/cdrio.h>
|
|
|
|
#endif
|
|
|
|
|
2005-11-18 14:39:25 +00:00
|
|
|
#include "m_option.h"
|
2001-08-09 01:17:24 +00:00
|
|
|
#include "stream.h"
|
2006-08-04 17:01:29 +00:00
|
|
|
#include "libmpdemux/demuxer.h"
|
2001-08-09 01:17:24 +00:00
|
|
|
|
|
|
|
|
2003-03-30 17:07:31 +00:00
|
|
|
/// We keep these 2 for the gui atm, but they will be removed.
|
2005-05-15 20:52:06 +00:00
|
|
|
int vcd_track=0;
|
2002-01-17 20:40:07 +00:00
|
|
|
char* cdrom_device=NULL;
|
2005-12-14 21:52:41 +00:00
|
|
|
int dvd_chapter=1;
|
|
|
|
int dvd_last_chapter=0;
|
|
|
|
char* dvd_device=NULL;
|
|
|
|
int dvd_title=0;
|
2002-03-28 20:40:21 +00:00
|
|
|
|
2001-08-09 01:17:24 +00:00
|
|
|
// Open a new stream (stdin/file/vcd/url)
|
|
|
|
|
2008-04-23 03:35:36 +00:00
|
|
|
stream_t* open_stream(char* filename, struct MPOpts *options, int* file_format)
|
|
|
|
{
|
2009-07-06 23:26:13 +00:00
|
|
|
// Check if playlist or unknown
|
2004-04-17 16:46:41 +00:00
|
|
|
if (*file_format != DEMUXER_TYPE_PLAYLIST){
|
|
|
|
*file_format=DEMUXER_TYPE_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2003-03-30 17:07:31 +00:00
|
|
|
if(!filename) {
|
|
|
|
mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
2001-08-09 01:17:24 +00:00
|
|
|
|
2003-04-08 05:14:43 +00:00
|
|
|
//============ Open STDIN or plain FILE ============
|
2002-08-05 00:39:07 +00:00
|
|
|
|
2003-04-02 16:26:58 +00:00
|
|
|
return open_stream_full(filename,STREAM_READ,options,file_format);
|
2001-08-09 01:17:24 +00:00
|
|
|
}
|