annotate stream/stream_file.c @ 25376:382aeacc771f

The buffer used for pread need be aligned, but currently it got an offset 23 to the structure head. This will cause the pread always got random data on some machines (such as my iMac G5 PPC with 10.5 os) so can not play vcd. I also tried use DKIOCCDREAD ioctl call, but the result is same -- buffer need be aligned. It could be a bug of os x or its dev lib. Now fix this problem by move the buffer to a good aligned position in structure.
author ulion
date Sat, 15 Dec 2007 12:17:51 +0000
parents 371a40dcc1cc
children 68015115f63a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
1
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
2 #include "config.h"
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
3
16748
ec02252fbaa6 we need stdio.h for SEEK_SET on mingw, patch by Zuxy <zuxy.meng at gmail.com>
faust3
parents: 15461
diff changeset
4 #include <stdio.h>
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
5 #include <sys/types.h>
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
6 #include <sys/stat.h>
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
7 #include <fcntl.h>
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
8 #include <unistd.h>
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
9
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
10 #include "mp_msg.h"
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
11 #include "stream.h"
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
12 #include "help_mp.h"
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16750
diff changeset
13 #include "m_option.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 16750
diff changeset
14 #include "m_struct.h"
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
15
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
16 static struct stream_priv_s {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
17 char* filename;
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
18 char *filename2;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
19 } stream_priv_dflts = {
15452
de27bb6ff3ec make file:// prefix work
nicodvb
parents: 12921
diff changeset
20 NULL, NULL
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
21 };
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
22
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
23 #define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f)
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
24 /// URL definition
25242
371a40dcc1cc stream_opts arrays should be const
reimar
parents: 25211
diff changeset
25 static const m_option_t stream_opts_fields[] = {
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
26 {"string", ST_OFF(filename), CONF_TYPE_STRING, 0, 0 ,0, NULL},
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
27 {"filename", ST_OFF(filename2), CONF_TYPE_STRING, 0, 0 ,0, NULL},
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
28 { NULL, NULL, 0, 0, 0, 0, NULL }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
29 };
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
30 static struct m_struct_st stream_opts = {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
31 "file",
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
32 sizeof(struct stream_priv_s),
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
33 &stream_priv_dflts,
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
34 stream_opts_fields
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
35 };
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
36
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
37 static int fill_buffer(stream_t *s, char* buffer, int max_len){
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
38 int r = read(s->fd,buffer,max_len);
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
39 return (r <= 0) ? -1 : r;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
40 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
41
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
42 static int write_buffer(stream_t *s, char* buffer, int len) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
43 int r = write(s->fd,buffer,len);
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
44 return (r <= 0) ? -1 : r;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
45 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
46
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
47 static int seek(stream_t *s,off_t newpos) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
48 s->pos = newpos;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
49 if(lseek(s->fd,s->pos,SEEK_SET)<0) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
50 s->eof=1;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
51 return 0;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
52 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
53 return 1;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
54 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
55
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
56 static int seek_forward(stream_t *s,off_t newpos) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
57 if(newpos<s->pos){
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
58 mp_msg(MSGT_STREAM,MSGL_INFO,"Cannot seek backward in linear streams!\n");
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
59 return 0;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
60 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
61 while(s->pos<newpos){
12018
2c2fb4457982 Seek in HTTP streams and stdin seek fixes
rtognimp
parents: 10608
diff changeset
62 int len=s->fill_buffer(s,s->buffer,STREAM_BUFFER_SIZE);
2c2fb4457982 Seek in HTTP streams and stdin seek fixes
rtognimp
parents: 10608
diff changeset
63 if(len<=0){ s->eof=1; s->buf_pos=s->buf_len=0; break; } // EOF
2c2fb4457982 Seek in HTTP streams and stdin seek fixes
rtognimp
parents: 10608
diff changeset
64 s->buf_pos=0;
2c2fb4457982 Seek in HTTP streams and stdin seek fixes
rtognimp
parents: 10608
diff changeset
65 s->buf_len=len;
2c2fb4457982 Seek in HTTP streams and stdin seek fixes
rtognimp
parents: 10608
diff changeset
66 s->pos+=len;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
67 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
68 return 1;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
69 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
70
21658
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
71 static int control(stream_t *s, int cmd, void *arg) {
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
72 switch(cmd) {
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
73 case STREAM_CTRL_GET_SIZE: {
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
74 off_t size;
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
75
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
76 size = lseek(s->fd, 0, SEEK_END);
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
77 lseek(s->fd, s->pos, SEEK_SET);
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
78 if(size != (off_t)-1) {
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
79 *((off_t*)arg) = size;
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
80 return 1;
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
81 }
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
82 }
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
83 }
24257
d261f5109660 cosmetics: typo fix UNSUPORTED --> UNSUPPORTED
diego
parents: 22451
diff changeset
84 return STREAM_UNSUPPORTED;
21658
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
85 }
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
86
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
87 static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
88 int f;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
89 mode_t m = 0;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
90 off_t len;
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
91 unsigned char *filename;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
92 struct stream_priv_s* p = (struct stream_priv_s*)opts;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
93
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
94 if(mode == STREAM_READ)
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
95 m = O_RDONLY;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
96 else if(mode == STREAM_WRITE)
22451
86f7b9cab33b truncate mencoder's output file if it exists, instead of overwriting just part of it.
lorenm
parents: 21705
diff changeset
97 m = O_RDWR|O_CREAT|O_TRUNC;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
98 else {
10608
2cae82f2ab02 Spelling police:
diego
parents: 9849
diff changeset
99 mp_msg(MSGT_OPEN,MSGL_ERR, "[file] Unknown open mode %d\n",mode);
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
100 m_struct_free(&stream_opts,opts);
24257
d261f5109660 cosmetics: typo fix UNSUPORTED --> UNSUPPORTED
diego
parents: 22451
diff changeset
101 return STREAM_UNSUPPORTED;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
102 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
103
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
104 if(p->filename)
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
105 filename = p->filename;
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
106 else if(p->filename2)
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
107 filename = p->filename2;
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
108 else
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
109 filename = NULL;
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
110 if(!filename) {
9849
5b649442fe72 Check that we really got a filename.
albeu
parents: 9827
diff changeset
111 mp_msg(MSGT_OPEN,MSGL_ERR, "[file] No filename\n");
5b649442fe72 Check that we really got a filename.
albeu
parents: 9827
diff changeset
112 m_struct_free(&stream_opts,opts);
5b649442fe72 Check that we really got a filename.
albeu
parents: 9827
diff changeset
113 return STREAM_ERROR;
5b649442fe72 Check that we really got a filename.
albeu
parents: 9827
diff changeset
114 }
5b649442fe72 Check that we really got a filename.
albeu
parents: 9827
diff changeset
115
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
116 #if defined(__CYGWIN__)|| defined(__MINGW32__)
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
117 m |= O_BINARY;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
118 #endif
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
119
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
120 if(!strcmp(filename,"-")){
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
121 if(mode == STREAM_READ) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
122 // read from stdin
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
123 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN);
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
124 f=0; // 0=stdin
12921
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
125 #ifdef __MINGW32__
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
126 setmode(fileno(stdin),O_BINARY);
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
127 #endif
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
128 } else {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
129 mp_msg(MSGT_OPEN,MSGL_INFO,"Writing to stdout\n");
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
130 f=1;
12921
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
131 #ifdef __MINGW32__
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
132 setmode(fileno(stdout),O_BINARY);
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
133 #endif
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
134 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
135 } else {
21656
32c50eb3ff18 in STREAM_WRITE mode open the stream with O_RDWR|O_CREAT, S_IRUSR|S_IWUSR and disable seek_forward for pipes
nicodvb
parents: 19271
diff changeset
136 if(mode == STREAM_READ)
32c50eb3ff18 in STREAM_WRITE mode open the stream with O_RDWR|O_CREAT, S_IRUSR|S_IWUSR and disable seek_forward for pipes
nicodvb
parents: 19271
diff changeset
137 f=open(filename,m);
21705
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
138 else {
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
139 mode_t openmode = S_IRUSR|S_IWUSR;
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
140 #ifndef __MINGW32__
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
141 openmode |= S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
142 #endif
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
143 f=open(filename,m, openmode);
829b1f30a07f fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
nicodvb
parents: 21673
diff changeset
144 }
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
145 if(f<0) {
15461
7c272bfba96f fixed file:// syntax using newly introduced -string- urlpart
nicodvb
parents: 15452
diff changeset
146 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
147 m_struct_free(&stream_opts,opts);
9827
d179dbc45935 Little fix.
albeu
parents: 9794
diff changeset
148 return STREAM_ERROR;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
149 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
150 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
151
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
152 len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);
12921
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
153 #ifdef __MINGW32__
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
154 if(f==0 || len == -1) {
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
155 #else
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
156 if(len == -1) {
12921
1e42749917c8 mingw stdin fixes
faust3
parents: 12018
diff changeset
157 #endif
21656
32c50eb3ff18 in STREAM_WRITE mode open the stream with O_RDWR|O_CREAT, S_IRUSR|S_IWUSR and disable seek_forward for pipes
nicodvb
parents: 19271
diff changeset
158 if(mode == STREAM_READ) stream->seek = seek_forward;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
159 stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
160 stream->flags |= STREAM_SEEK_FW;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
161 } else if(len >= 0) {
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
162 stream->seek = seek;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
163 stream->end_pos = len;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
164 stream->type = STREAMTYPE_FILE;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
165 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
166
16750
0a31740dd5e6 Use PRI?64 defines as format strings for 64 bit variables.
reimar
parents: 16748
diff changeset
167 mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %"PRId64" bytes\n", (int64_t)len);
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
168
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
169 stream->fd = f;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
170 stream->fill_buffer = fill_buffer;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
171 stream->write_buffer = write_buffer;
21658
110286e8bbec implemented STREAM_CTRL_GET_SIZE
nicodvb
parents: 21656
diff changeset
172 stream->control = control;
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
173
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
174 m_struct_free(&stream_opts,opts);
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
175 return STREAM_OK;
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
176 }
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
177
25211
c1d17bd6683c Mark all stream_info_t as const
reimar
parents: 24257
diff changeset
178 const stream_info_t stream_info_file = {
9794
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
179 "File",
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
180 "file",
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
181 "Albeu",
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
182 "based on the code from ??? (probably Arpi)",
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
183 open_f,
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
184 { "file", "", NULL },
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
185 &stream_opts,
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
186 1 // Urls are an option string
f67d87b2d3c7 Stream modularization, the first step.
albeu
parents:
diff changeset
187 };