comparison libmpdemux/network.c @ 8890:c9cbfb9d720c

Finally commented out the code for autodetection based on the extension.
author bertrand
date Sat, 11 Jan 2003 14:02:23 +0000
parents 87e37d8cfb25
children aaca5f177b99
comparison
equal deleted inserted replaced
8889:18427eee9205 8890:c9cbfb9d720c
77 // OGG Streaming 77 // OGG Streaming
78 { "application/x-ogg", DEMUXER_TYPE_OGG } 78 { "application/x-ogg", DEMUXER_TYPE_OGG }
79 79
80 }; 80 };
81 81
82 /*
83 * An autodetection based on the extension is not a good idea.
84 *
82 static struct { 85 static struct {
83 char *extension; 86 char *extension;
84 int demuxer_type; 87 int demuxer_type;
85 } extensions_table[] = { 88 } extensions_table[] = {
86 { "mpeg", DEMUXER_TYPE_MPEG_PS }, 89 { "mpeg", DEMUXER_TYPE_MPEG_PS },
101 { "ogg", DEMUXER_TYPE_OGG }, 104 { "ogg", DEMUXER_TYPE_OGG },
102 { "wav", DEMUXER_TYPE_AUDIO }, 105 { "wav", DEMUXER_TYPE_AUDIO },
103 { "pls", DEMUXER_TYPE_PLAYLIST }, 106 { "pls", DEMUXER_TYPE_PLAYLIST },
104 { "m3u", DEMUXER_TYPE_PLAYLIST } 107 { "m3u", DEMUXER_TYPE_PLAYLIST }
105 }; 108 };
109 */
106 110
107 streaming_ctrl_t * 111 streaming_ctrl_t *
108 streaming_ctrl_new( ) { 112 streaming_ctrl_new( ) {
109 streaming_ctrl_t *streaming_ctrl; 113 streaming_ctrl_t *streaming_ctrl;
110 streaming_ctrl = (streaming_ctrl_t*)malloc(sizeof(streaming_ctrl_t)); 114 streaming_ctrl = (streaming_ctrl_t*)malloc(sizeof(streaming_ctrl_t));
444 // Checking for PNM:// 448 // Checking for PNM://
445 if( !strcasecmp(url->protocol, "pnm") ) { 449 if( !strcasecmp(url->protocol, "pnm") ) {
446 *file_format = DEMUXER_TYPE_REAL; 450 *file_format = DEMUXER_TYPE_REAL;
447 return 0; 451 return 0;
448 } 452 }
449 453
454 /*
455 * An autodetection based on the extension is not a good idea.
456 *
450 // Get the extension of the file if present 457 // Get the extension of the file if present
451 if( url->file!=NULL ) { 458 if( url->file!=NULL ) {
452 for( i=strlen(url->file) ; i>0 ; i-- ) { 459 for( i=strlen(url->file) ; i>0 ; i-- ) {
453 if( url->file[i]=='.' ) { 460 if( url->file[i]=='.' ) {
454 extension=(url->file)+i+1; 461 extension=(url->file)+i+1;
465 *file_format = extensions_table[i].demuxer_type; 472 *file_format = extensions_table[i].demuxer_type;
466 return 0; 473 return 0;
467 } 474 }
468 } 475 }
469 } 476 }
470 477 */
478
471 // Checking for RTSP 479 // Checking for RTSP
472 if( !strcasecmp(url->protocol, "rtsp") ) { 480 if( !strcasecmp(url->protocol, "rtsp") ) {
473 #ifdef STREAMING_LIVE_DOT_COM 481 #ifdef STREAMING_LIVE_DOT_COM
474 *file_format = DEMUXER_TYPE_RTP; 482 *file_format = DEMUXER_TYPE_RTP;
475 return 0; 483 return 0;