Mercurial > mplayer.hg
comparison libmpdemux/stream_null.c @ 9901:233802490b0e
Add a null streamv Currently used for tv and mf. Could be used to
implement /dev/zero on system how don't have it.
author | albeu |
---|---|
date | Thu, 10 Apr 2003 10:59:12 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9900:f36b9dda3082 | 9901:233802490b0e |
---|---|
1 | |
2 #include "config.h" | |
3 | |
4 #include <stdlib.h> | |
5 #include <string.h> | |
6 | |
7 #include "stream.h" | |
8 #include "demuxer.h" | |
9 | |
10 #ifdef USE_TV | |
11 extern char* tv_param_channel; | |
12 #endif | |
13 | |
14 | |
15 static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { | |
16 stream->type = STREAMTYPE_DUMMY; | |
17 | |
18 if(strncmp("mf://",stream->url,5) == 0) { | |
19 *file_format = DEMUXER_TYPE_MF; | |
20 } | |
21 #ifdef USE_TV | |
22 else if (strncmp("tv://",stream->url,5) == 0) { | |
23 *file_format = DEMUXER_TYPE_TV; | |
24 if(stream->url[5] != '\0') | |
25 tv_param_channel = strdup(stream->url + 5); | |
26 } | |
27 #endif | |
28 return 1; | |
29 } | |
30 | |
31 | |
32 stream_info_t stream_info_null = { | |
33 "Null stream", | |
34 "null", | |
35 "Albeu", | |
36 "", | |
37 open_s, | |
38 { | |
39 #ifdef USE_TV | |
40 "tv", | |
41 #endif | |
42 "mf", "null", NULL }, | |
43 NULL, | |
44 0 // Urls are an option string | |
45 }; |