From fdf9cb58ce03df58c25dc9dd0c9f939abd343183 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 16 Dec 2007 14:23:25 +0000 Subject: Tell the Real demuxer about http references. --- src/demuxers/demux_real.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/demuxers/demux_real.c') diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 11c5069eb..938e1ca24 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -820,8 +820,8 @@ static int demux_real_parse_references( demux_real_t *this) { if( !strncmp(&buf[i],"-->",3) ) comment = 0; - if( (!strncmp(&buf[i],"pnm://",6) || !strncmp(&buf[i],"rtsp://",7)) && - !comment ) { + if( (!strncmp(&buf[i],"pnm://",6) || !strncmp(&buf[i],"rtsp://",7) || + !strncmp(&buf[i],"http://",7)) && !comment ) { for(j=i; buf[j] && buf[j] != '"' && !isspace(buf[j]); j++ ) ; buf[j]='\0'; @@ -1532,7 +1532,8 @@ static int real_check_stream_type(uint8_t *buf, int len) return 1; buf[len] = '\0'; - if( strstr(buf,"pnm://") || strstr(buf,"rtsp://") || strstr(buf,"") ) + if( strstr(buf,"pnm://") || strstr(buf,"rtsp://") || strstr(buf,"") || + strstr(buf,"http://") ) return 2; return 0; -- cgit v1.2.3 From 528cbe3723dcdafc6eb80817721ea5cf6fb9b050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 21:36:15 +0100 Subject: Use calloc() when allocating an array of elements. --- src/demuxers/demux_real.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/demuxers/demux_real.c') diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index af74d979b..962030083 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -232,7 +232,7 @@ static void real_parse_index(demux_real_t *this) { if(index && entries) { /* Allocate memory for index */ - *index = xine_xmalloc(entries * sizeof(real_index_entry_t)); + *index = xine_xcalloc(entries, sizeof(real_index_entry_t)); /* Read index */ for(i = 0; i < entries; i++) { @@ -275,17 +275,17 @@ static mdpr_t *real_parse_mdpr(const char *data) { mdpr->duration=_X_BE_32(&data[28]); mdpr->stream_name_size=data[32]; - mdpr->stream_name=malloc(sizeof(char)*(mdpr->stream_name_size+1)); + mdpr->stream_name=calloc(mdpr->stream_name_size+1, sizeof(char)); memcpy(mdpr->stream_name, &data[33], mdpr->stream_name_size); mdpr->stream_name[(int)mdpr->stream_name_size]=0; mdpr->mime_type_size=data[33+mdpr->stream_name_size]; - mdpr->mime_type=malloc(sizeof(char)*(mdpr->mime_type_size+1)); + mdpr->mime_type=calloc(mdpr->mime_type_size+1, sizeof(char)); memcpy(mdpr->mime_type, &data[34+mdpr->stream_name_size], mdpr->mime_type_size); mdpr->mime_type[(int)mdpr->mime_type_size]=0; mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]); - mdpr->type_specific_data=malloc(sizeof(char)*(mdpr->type_specific_len)); + mdpr->type_specific_data=calloc(mdpr->type_specific_len, sizeof(char)); memcpy(mdpr->type_specific_data, &data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len); -- cgit v1.2.3