diff options
-rw-r--r-- | stream/http.c | 7 | ||||
-rw-r--r-- | stream/network.c | 10 |
2 files changed, 4 insertions, 13 deletions
diff --git a/stream/http.c b/stream/http.c index 91b05c6d1c..9d00f00f87 100644 --- a/stream/http.c +++ b/stream/http.c @@ -764,7 +764,6 @@ static void print_icy_metadata(HTTP_header_t *http_hdr) { //! If this function succeeds you must closesocket stream->fd static int http_streaming_start(stream_t *stream, int* file_format) { HTTP_header_t *http_hdr = NULL; - unsigned int i; int fd = stream->fd; int res = STREAM_UNSUPPORTED; int redirect = 0; @@ -853,16 +852,16 @@ static int http_streaming_start(stream_t *stream, int* file_format) { // Look if we can use the Content-Type content_type = http_get_field( http_hdr, "Content-Type" ); if( content_type!=NULL ) { + unsigned int i; + mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", content_type ); // Check in the mime type table for a demuxer type - i = 0; - while(mime_type_table[i].mime_type != NULL) { + for (i = 0; mime_type_table[i].mime_type != NULL; i++) { if( !strcasecmp( content_type, mime_type_table[i].mime_type ) ) { *file_format = mime_type_table[i].demuxer_type; res = seekable; goto out; } - i++; } } // Not found in the mime type table, don't fail, diff --git a/stream/network.c b/stream/network.c index 1da6f24ca9..c8667686ec 100644 --- a/stream/network.c +++ b/stream/network.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -//#define DUMP2FILE - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -114,13 +112,11 @@ const mime_struct_t mime_type_table[] = { streaming_ctrl_t * streaming_ctrl_new(void) { - streaming_ctrl_t *streaming_ctrl; - streaming_ctrl = malloc(sizeof(streaming_ctrl_t)); + streaming_ctrl_t *streaming_ctrl = calloc(1, sizeof(*streaming_ctrl)); if( streaming_ctrl==NULL ) { mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); return NULL; } - memset( streaming_ctrl, 0, sizeof(streaming_ctrl_t) ); return streaming_ctrl; } @@ -475,10 +471,6 @@ nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctr int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ) { return -1; - // To shut up gcc warning - fd++; - pos++; - stream_ctrl=NULL; } |