0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
mpv/libmpdemux/stream_null.c
albeu 66ec24b3e7 Add a null streamv Currently used for tv and mf. Could be used to
implement /dev/zero on system how don't have it.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9902 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-04-10 10:59:12 +00:00

46 lines
755 B
C

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "stream.h"
#include "demuxer.h"
#ifdef USE_TV
extern char* tv_param_channel;
#endif
static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
stream->type = STREAMTYPE_DUMMY;
if(strncmp("mf://",stream->url,5) == 0) {
*file_format = DEMUXER_TYPE_MF;
}
#ifdef USE_TV
else if (strncmp("tv://",stream->url,5) == 0) {
*file_format = DEMUXER_TYPE_TV;
if(stream->url[5] != '\0')
tv_param_channel = strdup(stream->url + 5);
}
#endif
return 1;
}
stream_info_t stream_info_null = {
"Null stream",
"null",
"Albeu",
"",
open_s,
{
#ifdef USE_TV
"tv",
#endif
"mf", "null", NULL },
NULL,
0 // Urls are an option string
};