Mercurial > mplayer.hg
annotate libmpdemux/demux_xmms.c @ 17950:ed98aabfcfcd
fix for the macosx tiger (groff 1.19.x) indentation issue
author | jonas |
---|---|
date | Sat, 25 Mar 2006 22:41:14 +0000 |
parents | b849a99cdc3c |
children | f72bc5754209 |
rev | line source |
---|---|
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
1 // This is not reentrant because of global static variables, but most of |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
2 // the plugins are not reentrant either perhaps |
8528 | 3 #include "config.h" |
4 | |
5 #include <stdlib.h> | |
6 #include <stdio.h> | |
7 #include <unistd.h> | |
8 #include <pthread.h> | |
9 #include <dlfcn.h> | |
10 #include <dirent.h> | |
11 #include <inttypes.h> | |
8623
440301fef3fe
Added/reordered #includes to silence warnings about "implicit declaration".
rathann
parents:
8611
diff
changeset
|
12 #include <string.h> |
440301fef3fe
Added/reordered #includes to silence warnings about "implicit declaration".
rathann
parents:
8611
diff
changeset
|
13 #include <sys/stat.h> |
8528 | 14 |
17012 | 15 #include "m_option.h" |
16 #include "libaf/af_format.h" | |
8528 | 17 #include "stream.h" |
18 #include "demuxer.h" | |
19 #include "stheader.h" | |
20 | |
21 #define XMMS_PACKETSIZE 65536 // some plugins won't play if this is too small | |
22 | |
23 #include "demux_xmms_plugin.h" | |
24 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
25 typedef struct { |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
26 uint64_t spos; // stream position in number of output bytes from 00:00:00 |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
27 InputPlugin* ip; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
28 } xmms_priv_t; |
8528 | 29 |
30 static pthread_mutex_t xmms_mutex; | |
31 static int format = 0x1; // Raw PCM | |
32 static char xmms_audiobuffer[XMMS_PACKETSIZE]; | |
33 static uint32_t xmms_channels; | |
34 static uint32_t xmms_samplerate; | |
35 static uint32_t xmms_afmt; | |
36 static int xmms_length; | |
37 static char *xmms_title=NULL; | |
38 static uint32_t xmms_audiopos=0; | |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
39 static int xmms_playing=0; |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
40 static xmms_priv_t *xmms_priv=NULL; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
41 static uint32_t xmms_byterate; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
42 static int64_t xmms_flushto=-1; |
8528 | 43 |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
44 // =========== mplayer xmms outputplugin stuff ============== |
8528 | 45 |
46 static void disk_close(void) {} | |
47 static void disk_pause(short p) {} | |
48 static void disk_init(void) {} | |
49 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
50 static void disk_flush(int time) { |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
51 if (xmms_priv) xmms_flushto=time*((long long) xmms_byterate)/1000LL; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
52 } |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
53 |
8528 | 54 static int disk_free(void) { // vqf plugin sends more than it should |
55 return (XMMS_PACKETSIZE-xmms_audiopos<XMMS_PACKETSIZE/4 ? 0:XMMS_PACKETSIZE-xmms_audiopos-XMMS_PACKETSIZE/4); | |
56 } | |
57 | |
58 static int disk_playing(void) { | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
59 return 0; //?? maybe plugins wait on exit until oplugin is not playing? |
8528 | 60 } |
61 | |
62 static int disk_get_output_time(void) { | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
63 if (xmms_byterate) |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
64 return xmms_priv->spos*1000LL/((long long)xmms_byterate); |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
65 else return 0; |
8528 | 66 } |
67 | |
68 static int disk_open(AFormat fmt, int rate, int nch) { | |
69 switch (fmt) { | |
70 case FMT_U8: | |
14248 | 71 xmms_afmt=AF_FORMAT_U8; |
8528 | 72 break; |
73 case FMT_S8: | |
14248 | 74 xmms_afmt=AF_FORMAT_S8; |
8528 | 75 break; |
76 case FMT_U16_LE: | |
14248 | 77 xmms_afmt=AF_FORMAT_U16_LE; |
8528 | 78 break; |
79 case FMT_U16_NE: | |
80 #if WORDS_BIGENDIAN | |
14248 | 81 xmms_afmt=AF_FORMAT_U16_BE; |
8528 | 82 #else |
14248 | 83 xmms_afmt=AF_FORMAT_U16_LE; |
8528 | 84 #endif |
85 break; | |
86 case FMT_U16_BE: | |
14248 | 87 xmms_afmt=AF_FORMAT_U16_BE; |
8528 | 88 break; |
89 case FMT_S16_NE: | |
14248 | 90 xmms_afmt=AF_FORMAT_S16_NE; |
8528 | 91 break; |
92 case FMT_S16_LE: | |
14248 | 93 xmms_afmt=AF_FORMAT_S16_LE; |
8528 | 94 break; |
95 case FMT_S16_BE: | |
14248 | 96 xmms_afmt=AF_FORMAT_S16_BE; |
8528 | 97 break; |
98 } | |
99 xmms_samplerate=rate; | |
100 xmms_channels=nch; | |
101 return 1; | |
102 } | |
103 | |
104 static void disk_write(void *ptr, int length) { | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
105 if (!xmms_playing) return; |
8528 | 106 pthread_mutex_lock(&xmms_mutex); |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
107 if (xmms_flushto!=-1) { |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
108 xmms_priv->spos=xmms_flushto; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
109 xmms_flushto=-1; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
110 xmms_audiopos=0; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
111 } |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
112 xmms_priv->spos+= length; |
8528 | 113 memcpy(&xmms_audiobuffer[xmms_audiopos],ptr,length); |
114 xmms_audiopos+=length; | |
115 pthread_mutex_unlock(&xmms_mutex); | |
116 } | |
117 | |
118 static OutputPlugin xmms_output_plugin = | |
119 { | |
120 NULL, | |
121 NULL, | |
12860 | 122 "MPlayer output interface plugin ", /* Description */ |
8528 | 123 disk_init, |
124 NULL, /* about */ | |
125 NULL, /* configure */ | |
126 NULL, /* get_volume */ | |
127 NULL, /* set_volume */ | |
128 disk_open, | |
129 disk_write, | |
130 disk_close, | |
131 disk_flush, | |
132 disk_pause, | |
133 disk_free, | |
134 disk_playing, | |
135 disk_get_output_time, | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
136 disk_get_output_time //we pretend that everything written is played at once |
8528 | 137 }; |
138 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
139 // ==================== mplayer xmms inputplugin helper stuff ================= |
8528 | 140 |
141 static InputPlugin* input_plugins[100]; | |
142 static int no_plugins=0; | |
143 | |
144 /* Dummy functions */ | |
10211
4bc481804519
warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
alex
parents:
9211
diff
changeset
|
145 static InputVisType input_get_vis_type(){return 0;} |
8528 | 146 static void input_add_vis_pcm(int time, AFormat fmt, int nch, int length, void *ptr){} |
147 static void input_set_info_text(char * text){} | |
9211 | 148 char *xmms_get_gentitle_format(){ return ""; } |
8528 | 149 /* Dummy functions END*/ |
150 | |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
151 static void input_set_info(char* title,int length, int rate, int freq, int nch){ |
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
152 xmms_length=length; |
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
153 } |
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
154 |
8528 | 155 static void init_plugins(){ |
156 DIR *dir; | |
157 struct dirent *ent; | |
158 | |
159 no_plugins=0; | |
160 | |
161 dir = opendir(XMMS_INPUT_PLUGIN_DIR); | |
162 if (!dir) return; | |
163 | |
164 while ((ent = readdir(dir)) != NULL){ | |
165 char filename[strlen(XMMS_INPUT_PLUGIN_DIR)+strlen(ent->d_name)+4]; | |
166 void* handle; | |
167 sprintf(filename,XMMS_INPUT_PLUGIN_DIR "/%s",ent->d_name); | |
168 handle=dlopen(filename, RTLD_NOW); | |
169 if(handle){ | |
170 void *(*gpi) (void); | |
171 gpi=dlsym(handle, "get_iplugin_info"); | |
172 if(gpi){ | |
173 InputPlugin *p=gpi(); | |
174 printf("XMMS: found plugin: %s (%s)\n",ent->d_name,p->description); | |
175 p->handle = handle; | |
176 p->filename = strdup(filename); | |
177 p->get_vis_type = input_get_vis_type; | |
178 p->add_vis_pcm = input_add_vis_pcm; | |
179 p->set_info = input_set_info; | |
180 p->set_info_text = input_set_info_text; | |
181 if(p->init) p->init(); | |
182 input_plugins[no_plugins++]=p; | |
183 } else | |
184 dlclose(handle); | |
185 } | |
186 } | |
187 closedir(dir); | |
188 } | |
189 | |
190 static void cleanup_plugins(){ | |
191 while(no_plugins>0){ | |
192 --no_plugins; | |
193 printf("XMMS: Closing plugin %s\n",input_plugins[no_plugins]->filename); | |
194 if(input_plugins[no_plugins]->cleanup) | |
195 input_plugins[no_plugins]->cleanup(); | |
196 dlclose(input_plugins[no_plugins]->handle); | |
197 } | |
198 } | |
199 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
200 // ============================ mplayer demuxer stuff =============== |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
201 |
16175 | 202 static int demux_xmms_open(demuxer_t* demuxer) { |
8528 | 203 InputPlugin* ip = NULL; |
204 sh_audio_t* sh_audio; | |
205 WAVEFORMATEX* w; | |
206 xmms_priv_t *priv; | |
207 int i; | |
208 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
209 if (xmms_priv) return 0; // as I said, it's not reentrant :) |
8528 | 210 init_plugins(); |
211 for(i=0;i<no_plugins;i++){ | |
212 if (input_plugins[i]->is_our_file(demuxer->stream->url)){ | |
213 ip=input_plugins[i]; break; | |
214 } | |
215 } | |
216 if(!ip) return 0; // no plugin to handle this... | |
217 | |
218 pthread_mutex_init(&xmms_mutex,NULL); | |
219 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
220 xmms_priv=priv=(xmms_priv_t *)malloc(sizeof(xmms_priv_t)); |
8528 | 221 memset(priv,0,sizeof(xmms_priv_t)); |
222 priv->ip=ip; | |
223 | |
224 memset(xmms_audiobuffer,0,XMMS_PACKETSIZE); | |
225 | |
226 xmms_channels=0; | |
227 sh_audio = new_sh_audio(demuxer,0); | |
228 sh_audio->wf = w = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEX)); | |
229 w->wFormatTag = sh_audio->format = format; | |
230 | |
231 demuxer->movi_start = 0; | |
232 demuxer->movi_end = 100; | |
233 demuxer->audio->id = 0; | |
234 demuxer->audio->sh = sh_audio; | |
235 demuxer->priv=priv; | |
236 sh_audio->ds = demuxer->audio; | |
237 | |
238 xmms_output_plugin.init(); | |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
239 ip->output = &xmms_output_plugin; |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
240 xmms_playing=1; |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
241 ip->play_file(demuxer->stream->url); |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
242 if (ip->get_song_info) ip->get_song_info(demuxer->stream->url,&xmms_title,&xmms_length); |
8528 | 243 if (xmms_length<=0) demuxer->seekable=0; |
244 | |
245 mp_msg(MSGT_DEMUX,MSGL_INFO,"Waiting for the XMMS plugin to start playback of '%s'...\n",demuxer->stream->url); | |
246 while (xmms_channels==0) { | |
247 usleep(10000); | |
248 if(ip->get_time()<0) return 0; | |
249 } | |
250 sh_audio->sample_format= xmms_afmt; | |
251 switch (xmms_afmt) { | |
14248 | 252 case AF_FORMAT_S16_LE: |
253 case AF_FORMAT_S16_BE: | |
254 case AF_FORMAT_U16_LE: | |
255 case AF_FORMAT_U16_BE: | |
8528 | 256 sh_audio->samplesize = 2; |
257 break; | |
258 default: | |
259 sh_audio->samplesize = 1; | |
260 } | |
261 w->wBitsPerSample = sh_audio->samplesize*8; | |
262 w->nChannels = sh_audio->channels = xmms_channels; | |
263 w->nSamplesPerSec = sh_audio->samplerate = xmms_samplerate; | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
264 xmms_byterate = w->nAvgBytesPerSec = xmms_samplerate*sh_audio->channels*sh_audio->samplesize; |
8528 | 265 w->nBlockAlign = sh_audio->samplesize*sh_audio->channels; |
266 w->cbSize = 0; | |
267 | |
16175 | 268 return DEMUXER_TYPE_XMMS; |
8528 | 269 } |
270 | |
16175 | 271 static int demux_xmms_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds) { |
8528 | 272 sh_audio_t *sh_audio = demuxer->audio->sh; |
273 xmms_priv_t *priv=demuxer->priv; | |
274 demux_packet_t* dp; | |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
275 |
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
276 if (xmms_length<=0) demuxer->seekable=0; |
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
277 else demuxer->seekable=1; |
8528 | 278 |
279 while (xmms_audiopos<XMMS_PACKETSIZE/2) { | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
280 if((priv->ip->get_time()<0) || !xmms_playing) |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
281 return 0; |
8528 | 282 usleep(1000); |
283 } | |
284 | |
285 pthread_mutex_lock(&xmms_mutex); | |
286 dp = new_demux_packet(XMMS_PACKETSIZE/2); | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
287 ds->pts = priv->spos / sh_audio->wf->nAvgBytesPerSec; |
8528 | 288 ds->pos = priv->spos; |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
289 |
8528 | 290 memcpy(dp->buffer,xmms_audiobuffer,XMMS_PACKETSIZE/2); |
291 memcpy(xmms_audiobuffer,&xmms_audiobuffer[XMMS_PACKETSIZE/2],xmms_audiopos-XMMS_PACKETSIZE/2); | |
292 xmms_audiopos-=XMMS_PACKETSIZE/2; | |
293 pthread_mutex_unlock(&xmms_mutex); | |
294 | |
295 ds_add_packet(ds,dp); | |
296 | |
297 return 1; | |
298 } | |
299 | |
17636 | 300 static void demux_xmms_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags){ |
8528 | 301 stream_t* s = demuxer->stream; |
302 sh_audio_t* sh_audio = demuxer->audio->sh; | |
303 xmms_priv_t *priv=demuxer->priv; | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
304 int32_t pos; |
8528 | 305 |
306 if(priv->ip->get_time()<0) return; | |
307 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
308 pos = (flags & 1) ? 0 : priv->spos / sh_audio->wf->nAvgBytesPerSec; |
8528 | 309 if (flags & 2) |
310 pos+= rel_seek_secs*xmms_length; | |
311 else | |
312 pos+= rel_seek_secs; | |
313 | |
314 if (pos<0) pos=0; | |
315 if (pos>=xmms_length) pos=xmms_length-1; | |
316 | |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
317 priv->ip->seek((pos<0)?0:pos); |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
318 priv->spos=pos * sh_audio->wf->nAvgBytesPerSec; |
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
319 sh_audio->delay=pos; //priv->spos / sh_audio->wf->nAvgBytesPerSec; |
8528 | 320 } |
321 | |
16175 | 322 static void demux_close_xmms(demuxer_t* demuxer) { |
8528 | 323 xmms_priv_t *priv=demuxer->priv; |
8536
ff192e1b018f
xmp hangign I noticed too, and is fixed with this patch, seeking works now
arpi
parents:
8528
diff
changeset
|
324 xmms_playing=0; |
8542
222c0a39c977
I cleaned up the source a bit, hopefully fixed hanging, also
arpi
parents:
8536
diff
changeset
|
325 xmms_audiopos=0; // xmp on exit waits until buffer is free enough |
8611
668161e96ab9
The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
arpi
parents:
8542
diff
changeset
|
326 if (priv != NULL) { |
668161e96ab9
The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
arpi
parents:
8542
diff
changeset
|
327 if (priv->ip != NULL) |
668161e96ab9
The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
arpi
parents:
8542
diff
changeset
|
328 priv->ip->stop(); |
668161e96ab9
The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
arpi
parents:
8542
diff
changeset
|
329 free(priv); xmms_priv=demuxer->priv=NULL; |
668161e96ab9
The patch fixes a nullpointer dereference and free of NULL in demux_close_xmms
arpi
parents:
8542
diff
changeset
|
330 } |
8528 | 331 cleanup_plugins(); |
332 } | |
333 | |
16175 | 334 static int demux_xmms_control(demuxer_t *demuxer,int cmd, void *arg){ |
8528 | 335 demux_stream_t *d_video=demuxer->video; |
336 sh_audio_t *sh_audio=demuxer->audio->sh; | |
337 xmms_priv_t *priv=demuxer->priv; | |
338 | |
339 switch(cmd) { | |
340 case DEMUXER_CTRL_GET_TIME_LENGTH: | |
341 if (xmms_length<=0) return DEMUXER_CTRL_DONTKNOW; | |
16346
6ff303d2876b
Make -identify's 'ID_LENGTH=' print a float and not an integer.. The
ods15
parents:
16175
diff
changeset
|
342 *((double *)arg)=(double)xmms_length/1000; |
8528 | 343 return DEMUXER_CTRL_GUESS; |
344 | |
345 case DEMUXER_CTRL_GET_PERCENT_POS: | |
346 if (xmms_length<=0) | |
347 return DEMUXER_CTRL_DONTKNOW; | |
348 *((int *)arg)=(int)( priv->spos / (float)(sh_audio->wf->nAvgBytesPerSec) / xmms_length ); | |
349 return DEMUXER_CTRL_OK; | |
350 | |
351 default: | |
352 return DEMUXER_CTRL_NOTIMPL; | |
353 } | |
354 } | |
16175 | 355 |
356 | |
357 demuxer_desc_t demuxer_desc_xmms = { | |
358 "XMMS demuxer", | |
359 "xmms", | |
360 "XMMS", | |
361 "?", | |
362 "requires XMMS plugins", | |
363 DEMUXER_TYPE_XMMS, | |
364 0, // safe autodetect | |
365 demux_xmms_open, | |
366 demux_xmms_fill_buffer, | |
367 NULL, | |
368 demux_close_xmms, | |
369 demux_xmms_seek, | |
370 demux_xmms_control | |
371 }; |