comparison stream/stream.c @ 27397:d47744b95b78

Give a CONFIG_ prefix to preprocessor directives that lacked one and change arbitrary prefixes to CONFIG_.
author diego
date Thu, 07 Aug 2008 12:20:50 +0000
parents 1d2faa1020fb
children 5a30f5bc23a0
comparison
equal deleted inserted replaced
27396:51438cb89305 27397:d47744b95b78
69 &stream_info_vcd, 69 &stream_info_vcd,
70 #endif 70 #endif
71 #ifdef CONFIG_CDDA 71 #ifdef CONFIG_CDDA
72 &stream_info_cdda, 72 &stream_info_cdda,
73 #endif 73 #endif
74 #ifdef MPLAYER_NETWORK 74 #ifdef CONFIG_NETWORK
75 &stream_info_netstream, 75 &stream_info_netstream,
76 &stream_info_http1, 76 &stream_info_http1,
77 &stream_info_asf, 77 &stream_info_asf,
78 &stream_info_pnm, 78 &stream_info_pnm,
79 &stream_info_rtsp, 79 &stream_info_rtsp,
80 #ifdef STREAMING_LIVE555 80 #ifdef CONFIG_LIVE555
81 &stream_info_sdp, 81 &stream_info_sdp,
82 &stream_info_rtsp_sip, 82 &stream_info_rtsp_sip,
83 #endif 83 #endif
84 &stream_info_rtp, 84 &stream_info_rtp,
85 &stream_info_udp, 85 &stream_info_udp,
101 &stream_info_ftp, 101 &stream_info_ftp,
102 #endif 102 #endif
103 #ifdef CONFIG_VSTREAM 103 #ifdef CONFIG_VSTREAM
104 &stream_info_vstream, 104 &stream_info_vstream,
105 #endif 105 #endif
106 #ifdef LIBSMBCLIENT 106 #ifdef CONFIG_LIBSMBCLIENT
107 &stream_info_smb, 107 &stream_info_smb,
108 #endif 108 #endif
109 &stream_info_cue, 109 &stream_info_cue,
110 #ifdef CONFIG_DVDREAD 110 #ifdef CONFIG_DVDREAD
111 &stream_info_ifo, 111 &stream_info_ifo,
154 s = new_stream(-2,-2); 154 s = new_stream(-2,-2);
155 s->url=strdup(filename); 155 s->url=strdup(filename);
156 s->flags |= mode; 156 s->flags |= mode;
157 *ret = sinfo->open(s,mode,arg,file_format); 157 *ret = sinfo->open(s,mode,arg,file_format);
158 if((*ret) != STREAM_OK) { 158 if((*ret) != STREAM_OK) {
159 #ifdef MPLAYER_NETWORK 159 #ifdef CONFIG_NETWORK
160 if (*ret == STREAM_REDIRECTED && redirected_url) { 160 if (*ret == STREAM_REDIRECTED && redirected_url) {
161 if (s->streaming_ctrl && s->streaming_ctrl->url 161 if (s->streaming_ctrl && s->streaming_ctrl->url
162 && s->streaming_ctrl->url->url) 162 && s->streaming_ctrl->url->url)
163 *redirected_url = strdup(s->streaming_ctrl->url->url); 163 *redirected_url = strdup(s->streaming_ctrl->url->url);
164 else 164 else
245 int stream_fill_buffer(stream_t *s){ 245 int stream_fill_buffer(stream_t *s){
246 int len; 246 int len;
247 if (/*s->fd == NULL ||*/ s->eof) { s->buf_pos = s->buf_len = 0; return 0; } 247 if (/*s->fd == NULL ||*/ s->eof) { s->buf_pos = s->buf_len = 0; return 0; }
248 switch(s->type){ 248 switch(s->type){
249 case STREAMTYPE_STREAM: 249 case STREAMTYPE_STREAM:
250 #ifdef MPLAYER_NETWORK 250 #ifdef CONFIG_NETWORK
251 if( s->streaming_ctrl!=NULL && s->streaming_ctrl->streaming_read ) { 251 if( s->streaming_ctrl!=NULL && s->streaming_ctrl->streaming_read ) {
252 len=s->streaming_ctrl->streaming_read(s->fd,s->buffer,STREAM_BUFFER_SIZE, s->streaming_ctrl);break; 252 len=s->streaming_ctrl->streaming_read(s->fd,s->buffer,STREAM_BUFFER_SIZE, s->streaming_ctrl);break;
253 } else { 253 } else {
254 len=read(s->fd,s->buffer,STREAM_BUFFER_SIZE);break; 254 len=read(s->fd,s->buffer,STREAM_BUFFER_SIZE);break;
255 } 255 }
312 case STREAMTYPE_STREAM: 312 case STREAMTYPE_STREAM:
313 //s->pos=newpos; // real seek 313 //s->pos=newpos; // real seek
314 // Some streaming protocol allow to seek backward and forward 314 // Some streaming protocol allow to seek backward and forward
315 // A function call that return -1 can tell that the protocol 315 // A function call that return -1 can tell that the protocol
316 // doesn't support seeking. 316 // doesn't support seeking.
317 #ifdef MPLAYER_NETWORK 317 #ifdef CONFIG_NETWORK
318 if(s->seek) { // new stream seek is much cleaner than streaming_ctrl one 318 if(s->seek) { // new stream seek is much cleaner than streaming_ctrl one
319 if(!s->seek(s,newpos)) { 319 if(!s->seek(s,newpos)) {
320 mp_msg(MSGT_STREAM,MSGL_ERR, "Seek failed\n"); 320 mp_msg(MSGT_STREAM,MSGL_ERR, "Seek failed\n");
321 return 0; 321 return 0;
322 } 322 }