summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demuxers/asfheader.h4
-rw-r--r--src/input/http_helper.c8
-rw-r--r--src/input/input_http.c8
-rw-r--r--src/input/input_mms.c4
-rw-r--r--src/input/input_net.c4
-rw-r--r--src/input/input_pnm.c2
-rw-r--r--src/input/input_pvr.c14
-rw-r--r--src/input/input_rtsp.c2
-rw-r--r--src/input/input_smb.c4
-rw-r--r--src/input/input_stdin_fifo.c4
-rw-r--r--src/input/mms.c37
-rw-r--r--src/input/mms.h4
-rw-r--r--src/input/mmsh.c28
-rw-r--r--src/input/mmsh.h4
-rw-r--r--src/input/pnm.c42
15 files changed, 83 insertions, 86 deletions
diff --git a/src/demuxers/asfheader.h b/src/demuxers/asfheader.h
index 2f2fd6705..1b6bade91 100644
--- a/src/demuxers/asfheader.h
+++ b/src/demuxers/asfheader.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: asfheader.h,v 1.5 2006/04/08 16:42:24 valtri Exp $
+ * $Id: asfheader.h,v 1.6 2006/06/20 01:46:41 dgp85 Exp $
*
* demultiplexer for asf streams
*
@@ -129,7 +129,7 @@ static const struct
} guids[] =
{
{ "error",
- { 0x0,} },
+ { 0x0, 0x0, 0x0, { 0x0 } } },
/* base ASF objects */
diff --git a/src/input/http_helper.c b/src/input/http_helper.c
index 6a44a2ad6..a725abc39 100644
--- a/src/input/http_helper.c
+++ b/src/input/http_helper.c
@@ -19,7 +19,7 @@
*
* URL helper functions
*
- * $Id: http_helper.c,v 1.6 2006/03/18 09:15:00 tmattern Exp $
+ * $Id: http_helper.c,v 1.7 2006/06/20 01:46:41 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -196,7 +196,7 @@ error:
char *_x_canonicalise_url (const char *base, const char *url) {
- int base_length;
+ size_t base_length;
char *cut, *ret;
if ((cut = strstr (url, "://")))
@@ -213,9 +213,9 @@ char *_x_canonicalise_url (const char *base, const char *url) {
if (cut)
++cut;
}
- base_length = cut ? cut - base : strlen (base);
+ base_length = cut ? (size_t)(cut - base) : strlen (base);
ret = malloc (base_length + strlen (url) + 1);
- sprintf (ret, "%.*s%s", base_length, base, url);
+ sprintf (ret, "%.*s%s", (int)base_length, base, url);
return ret;
}
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 07a38f60b..24b7df78c 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -19,7 +19,7 @@
*
* input plugin for http network streams
*
- * $Id: input_http.c,v 1.118 2006/06/06 16:39:25 mshopf Exp $
+ * $Id: input_http.c,v 1.119 2006/06/20 01:46:41 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -286,7 +286,7 @@ static int http_plugin_read_metainf (http_input_plugin_t *this) {
xine_ui_data_t data;
/* get the length of the metadata */
- if (_x_io_tcp_read (this->stream, this->fh, &len, 1) != 1)
+ if (_x_io_tcp_read (this->stream, this->fh, (char*)&len, 1) != 1)
return 0;
lprintf ("http_plugin_read_metainf: len=%d\n", len);
@@ -439,7 +439,7 @@ static int resync_nsv(http_input_plugin_t *this) {
lprintf("resyncing NSV stream\n");
while ((pos < 3) && (read_bytes < (1024*1024))) {
- if (http_plugin_read_int(this, &c, 1) != 1)
+ if (http_plugin_read_int(this, (char*)&c, 1) != 1)
return 1;
this->preview[pos] = c;
@@ -486,7 +486,7 @@ static buf_element_t *http_plugin_read_block (input_plugin_t *this_gen, fifo_buf
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = http_plugin_read (this_gen, buf->content, todo);
+ total_bytes = http_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index f71171dfc..e6aa63312 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_mms.c,v 1.61 2006/05/03 19:46:07 dsalt Exp $
+ * $Id: input_mms.c,v 1.62 2006/06/20 01:46:41 dgp85 Exp $
*
* mms input plugin based on work from major mms
*/
@@ -127,7 +127,7 @@ static buf_element_t *mms_plugin_read_block (input_plugin_t *this_gen,
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = mms_plugin_read (this_gen, buf->content, todo);
+ total_bytes = mms_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 8490dacbd..b06160fed 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -20,7 +20,7 @@
* Read from a tcp network stream over a lan (put a tweaked mp1e encoder the
* other end and you can watch tv anywhere in the house ..)
*
- * $Id: input_net.c,v 1.66 2006/05/03 19:46:07 dsalt Exp $
+ * $Id: input_net.c,v 1.67 2006/06/20 01:46:41 dgp85 Exp $
*
* how to set up mp1e for use with this plugin:
*
@@ -293,7 +293,7 @@ static buf_element_t *net_plugin_read_block (input_plugin_t *this_gen,
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = net_plugin_read (this_gen, buf->content, todo);
+ total_bytes = net_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index ffe6e66b4..cbf23c076 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -101,7 +101,7 @@ static buf_element_t *pnm_plugin_read_block (input_plugin_t *this_gen,
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = pnm_plugin_read (this_gen, buf->content, todo);
+ total_bytes = pnm_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 002b21b32..843e7c3e6 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -38,7 +38,7 @@
* usage:
* xine pvr:/<prefix_to_tmp_files>\!<prefix_to_saved_files>\!<max_page_age>
*
- * $Id: input_pvr.c,v 1.60 2006/05/03 19:46:07 dsalt Exp $
+ * $Id: input_pvr.c,v 1.61 2006/06/20 01:46:41 dgp85 Exp $
*/
/**************************************************************************
@@ -579,7 +579,7 @@ static int pvr_break_rec_page (pvr_input_plugin_t *this) {
char *filename;
- if( this->session == -1 ) /* not recording */
+ if( this->session == (unsigned)-1 ) /* not recording */
return 1;
if( this->rec_fd != -1 && this->rec_fd != this->play_fd ) {
@@ -607,9 +607,9 @@ static int pvr_break_rec_page (pvr_input_plugin_t *this) {
free(filename);
/* erase first_page if old and not to be saved */
- if( this->max_page_age != -1 &&
+ if( this->max_page_age != (unsigned)-1 &&
this->rec_page - this->max_page_age == this->first_page &&
- (this->save_page == -1 || this->first_page < this->save_page) ) {
+ (this->save_page == (unsigned)-1 || this->first_page < this->save_page) ) {
filename = make_temp_name(this, this->first_page);
@@ -635,7 +635,7 @@ static int pvr_rec_file(pvr_input_plugin_t *this) {
off_t pos;
- if( this->session == -1 ) /* not recording */
+ if( this->session == (unsigned)-1 ) /* not recording */
return 1;
/* check if it's time to change page/file */
@@ -907,7 +907,7 @@ static void pvr_finish_recording (pvr_input_plugin_t *this) {
src_filename = make_temp_name(this, i);
- if( this->save_page == -1 || i < this->save_page ) {
+ if( this->save_page == (unsigned)-1 || i < this->save_page ) {
lprintf("erasing old pvr file (%s)\n", src_filename);
remove(src_filename);
@@ -926,7 +926,7 @@ static void pvr_finish_recording (pvr_input_plugin_t *this) {
free(src_filename);
}
- if( this->save_page != -1 && (!this->save_name || !strlen(this->save_name)) ) {
+ if( this->save_page != (unsigned)-1 && (!this->save_name || !strlen(this->save_name)) ) {
saved_show_t *show = malloc(sizeof(saved_show_t));
xine_event_t event;
xine_pvr_save_data_t data;
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index 48c50e6fa..f78762bcb 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -102,7 +102,7 @@ static buf_element_t *rtsp_plugin_read_block (input_plugin_t *this_gen,
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = rtsp_plugin_read (this_gen, buf->content, todo);
+ total_bytes = rtsp_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index d1c1e46bf..cbd4d34cd 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_smb.c,v 1.13 2006/06/18 20:29:04 dgp85 Exp $
+ * $Id: input_smb.c,v 1.14 2006/06/20 01:46:41 dgp85 Exp $
*/
@@ -94,7 +94,7 @@ smb_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo,
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = smb_plugin_read (this_gen, buf->content, todo);
+ total_bytes = smb_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes == todo) buf->size = todo;
else
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index 3333a94e0..4b0dd66a6 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_stdin_fifo.c,v 1.65 2006/05/03 19:46:07 dsalt Exp $
+ * $Id: input_stdin_fifo.c,v 1.66 2006/06/20 01:46:41 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -126,7 +126,7 @@ static buf_element_t *stdin_plugin_read_block (input_plugin_t *this_gen, fifo_bu
buf->content = buf->mem;
buf->type = BUF_DEMUX_BLOCK;
- total_bytes = stdin_plugin_read (this_gen, buf->content, todo);
+ total_bytes = stdin_plugin_read (this_gen, (char*)buf->content, todo);
if (total_bytes != todo) {
buf->free_buffer (buf);
diff --git a/src/input/mms.c b/src/input/mms.c
index 48fcbdb30..472e52bfb 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.c,v 1.58 2006/06/10 00:21:51 dgp85 Exp $
+ * $Id: mms.c,v 1.59 2006/06/20 01:46:41 dgp85 Exp $
*
* MMS over TCP protocol
* based on work from major mms
@@ -153,8 +153,8 @@ struct mms_s {
};
-static void mms_buffer_init (mms_buffer_t *mms_buffer, uint8_t *buffer) {
- mms_buffer->buffer = buffer;
+static void mms_buffer_init (mms_buffer_t *mms_buffer, char *buffer) {
+ mms_buffer->buffer = (uint8_t*)buffer;
mms_buffer->pos = 0;
}
@@ -359,14 +359,14 @@ static int get_packet_header (mms_t *this, mms_packet_header_t *header) {
header->packet_seq = 0;
header->flags = 0;
header->packet_id_type = 0;
- len = _x_io_tcp_read (this->stream, this->s, this->buf, 8);
+ len = _x_io_tcp_read (this->stream, this->s, (char*)this->buf, 8);
if (len != 8)
goto error;
if (LE_32(this->buf + 4) == 0xb00bface) {
/* command packet */
header->flags = this->buf[3];
- len = _x_io_tcp_read (this->stream, this->s, this->buf + 8, 4);
+ len = _x_io_tcp_read (this->stream, this->s, (char*)(this->buf + 8), 4);
if (len != 4)
goto error;
@@ -403,12 +403,12 @@ static int get_packet_command (mms_t *this, uint32_t packet_len) {
/* always enter this loop */
lprintf("packet_len: %d bytes\n", packet_len);
- len = _x_io_tcp_read (this->stream, this->s, this->buf + 12, packet_len) ;
+ len = _x_io_tcp_read (this->stream, this->s, (char*)(this->buf + 12), packet_len) ;
if (len != packet_len) {
return 0;
}
- print_command (this->buf, len);
+ print_command ((char*)this->buf, len);
/* check protocol type ("MMS ") */
if (LE_32(this->buf + 12) != 0x20534D4D) {
@@ -498,7 +498,7 @@ static int get_asf_header (mms_t *this) {
case MMS_PACKET_ASF_HEADER:
case MMS_PACKET_ASF_PACKET:
len = _x_io_tcp_read (this->stream, this->s,
- this->asf_header + this->asf_header_len, header.packet_len);
+ (char*)(this->asf_header + this->asf_header_len), header.packet_len);
if (len != header.packet_len) {
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
"libmms: get_header failed\n");
@@ -517,7 +517,7 @@ static int get_asf_header (mms_t *this) {
static void interp_asf_header (mms_t *this) {
- int i;
+ unsigned int i;
this->asf_packet_len = 0;
this->num_stream_ids = 0;
@@ -714,11 +714,11 @@ static int mms_choose_best_streams(mms_t *this) {
int i;
int video_stream = 0;
int audio_stream = 0;
- int max_arate = 0;
- int min_vrate = 0;
- int min_bw_left = 0;
+ unsigned int max_arate = 0;
+ unsigned int min_vrate = 0;
+ unsigned int min_bw_left = 0;
int stream_id;
- int bandwitdh_left;
+ unsigned int bandwitdh_left;
int res;
/* command 0x33 */
@@ -740,10 +740,7 @@ static int mms_choose_best_streams(mms_t *this) {
}
/* choose a video stream adapted to the user bandwidth */
- bandwitdh_left = this->bandwidth - max_arate;
- if (bandwitdh_left < 0) {
- bandwitdh_left = 0;
- }
+ bandwitdh_left = (int)( this->bandwidth - max_arate ) < 0 ? 0 : this->bandwidth - max_arate;
lprintf("bandwitdh %d, left %d\n", this->bandwidth, bandwitdh_left);
min_bw_left = bandwitdh_left;
@@ -1189,7 +1186,7 @@ static int get_media_packet (mms_t *this) {
return 0;
}
- len = _x_io_tcp_read (this->stream, this->s, this->buf, header.packet_len);
+ len = _x_io_tcp_read (this->stream, this->s, (char*)this->buf, header.packet_len);
if (len != header.packet_len) {
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
"libmms: read failed\n");
@@ -1210,9 +1207,9 @@ static int get_media_packet (mms_t *this) {
}
-int mms_peek_header (mms_t *this, char *data, int maxsize) {
+size_t mms_peek_header (mms_t *this, char *data, size_t maxsize) {
- int len;
+ size_t len;
len = (this->asf_header_len < maxsize) ? this->asf_header_len : maxsize;
diff --git a/src/input/mms.h b/src/input/mms.h
index 3c1b4af81..f4b2928cd 100644
--- a/src/input/mms.h
+++ b/src/input/mms.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.h,v 1.11 2004/04/06 00:25:29 tmattern Exp $
+ * $Id: mms.h,v 1.12 2006/06/20 01:46:41 dgp85 Exp $
*
* libmms public header
*/
@@ -37,7 +37,7 @@ int mms_read (mms_t *this, char *data, int len);
uint32_t mms_get_length (mms_t *this);
void mms_close (mms_t *this);
-int mms_peek_header (mms_t *this, char *data, int maxsize);
+size_t mms_peek_header (mms_t *this, char *data, size_t maxsize);
off_t mms_get_current_pos (mms_t *this);
diff --git a/src/input/mmsh.c b/src/input/mmsh.c
index eb94ff299..3da85d0b0 100644
--- a/src/input/mmsh.c
+++ b/src/input/mmsh.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mmsh.c,v 1.36 2006/02/14 19:05:29 dsalt Exp $
+ * $Id: mmsh.c,v 1.37 2006/06/20 01:46:41 dgp85 Exp $
*
* MMS over HTTP protocol
* written by Thibaut Mattern
@@ -247,7 +247,7 @@ static int get_answer (mmsh_t *this) {
while (!done) {
- if (_x_io_tcp_read(this->stream, this->s, &(this->buf[len]), 1) != 1) {
+ if (_x_io_tcp_read(this->stream, this->s, (char*)&(this->buf[len]), 1) != 1) {
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
"libmmsh: alert: end of stream\n");
return 0;
@@ -271,7 +271,7 @@ static int get_answer (mmsh_t *this) {
int httpver, httpsub, httpcode;
char httpstatus[51];
- if (sscanf(this->buf, "HTTP/%d.%d %d %50[^\015\012]", &httpver, &httpsub,
+ if (sscanf((char*)this->buf, "HTTP/%d.%d %d %50[^\015\012]", &httpver, &httpsub,
&httpcode, httpstatus) != 4) {
xine_log (this->stream->xine, XINE_LOG_MSG,
_("libmmsh: bad response format\n"));
@@ -293,14 +293,14 @@ static int get_answer (mmsh_t *this) {
}
} else {
- if (!strncasecmp(this->buf, "Location: ", 10)) {
+ if (!strncasecmp((char*)this->buf, "Location: ", 10)) {
xine_log (this->stream->xine, XINE_LOG_MSG,
_("libmmsh: Location redirection not implemented\n"));
return 0;
}
- if (!strncasecmp(this->buf, "Pragma:", 7)) {
- features = strstr(this->buf + 7, "features=");
+ if (!strncasecmp((char*)this->buf, "Pragma:", 7)) {
+ features = strstr((char*)(this->buf + 7), "features=");
if (features) {
if (strstr(features, "seekable")) {
lprintf("seekable stream\n");
@@ -341,7 +341,7 @@ static int get_chunk_header (mmsh_t *this) {
lprintf ("get_chunk_header\n");
/* read chunk header */
- read_len = _x_io_tcp_read(this->stream, this->s, chunk_header, CHUNK_HEADER_LENGTH);
+ read_len = _x_io_tcp_read(this->stream, this->s, (char*)chunk_header, CHUNK_HEADER_LENGTH);
if (read_len != CHUNK_HEADER_LENGTH) {
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
"libmmsh: chunk header read failed, %d != %d\n", read_len, CHUNK_HEADER_LENGTH);
@@ -368,7 +368,7 @@ static int get_chunk_header (mmsh_t *this) {
}
/* read extended header */
if (ext_header_len > 0) {
- read_len = _x_io_tcp_read(this->stream, this->s, ext_header, ext_header_len);
+ read_len = _x_io_tcp_read(this->stream, this->s, (char*)ext_header, ext_header_len);
if (read_len != ext_header_len) {
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
"extended header read failed, %d != %d\n", read_len, ext_header_len);
@@ -430,7 +430,7 @@ static int get_header (mmsh_t *this) {
"libmmsh: the asf header exceed %d bytes\n", ASF_HEADER_SIZE);
return 0;
} else {
- len = _x_io_tcp_read(this->stream, this->s, this->asf_header + this->asf_header_len,
+ len = _x_io_tcp_read(this->stream, this->s, (char*)(this->asf_header + this->asf_header_len),
this->chunk_length);
this->asf_header_len += len;
if (len != this->chunk_length) {
@@ -448,7 +448,7 @@ static int get_header (mmsh_t *this) {
if (this->chunk_type == CHUNK_TYPE_DATA) {
/* read the first data chunk */
- len = _x_io_tcp_read(this->stream, this->s, this->buf, this->chunk_length);
+ len = _x_io_tcp_read(this->stream, this->s, (char*)this->buf, this->chunk_length);
if (len != this->chunk_length) {
return 0;
} else {
@@ -462,7 +462,7 @@ static int get_header (mmsh_t *this) {
static void interp_header (mmsh_t *this) {
- int i;
+ unsigned int i;
lprintf ("interp_header, header_len=%d\n", this->asf_header_len);
@@ -947,7 +947,7 @@ static int get_media_packet (mmsh_t *this) {
return 0;
}
- len = _x_io_tcp_read (this->stream, this->s, this->buf, this->chunk_length);
+ len = _x_io_tcp_read (this->stream, this->s, (char*)this->buf, this->chunk_length);
if (len == this->chunk_length) {
/* explicit padding with 0 */
@@ -971,8 +971,8 @@ static int get_media_packet (mmsh_t *this) {
}
}
-int mmsh_peek_header (mmsh_t *this, char *data, int maxsize) {
- int len;
+size_t mmsh_peek_header (mmsh_t *this, char *data, size_t maxsize) {
+ size_t len;
lprintf("mmsh_peek_header\n");
diff --git a/src/input/mmsh.h b/src/input/mmsh.h
index 4ae838526..8aee808f0 100644
--- a/src/input/mmsh.h
+++ b/src/input/mmsh.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mmsh.h,v 1.4 2004/04/06 00:25:29 tmattern Exp $
+ * $Id: mmsh.h,v 1.5 2006/06/20 01:46:41 dgp85 Exp $
*
* libmmsh public header
*/
@@ -37,7 +37,7 @@ int mmsh_read (mmsh_t *this, char *data, int len);
uint32_t mmsh_get_length (mmsh_t *this);
void mmsh_close (mmsh_t *this);
-int mmsh_peek_header (mmsh_t *this, char *data, int maxsize);
+size_t mmsh_peek_header (mmsh_t *this, char *data, size_t maxsize);
off_t mmsh_get_current_pos (mmsh_t *this);
diff --git a/src/input/pnm.c b/src/input/pnm.c
index 08b19a0da..432520f6e 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: pnm.c,v 1.21 2004/12/15 12:53:36 miguelfreitas Exp $
+ * $Id: pnm.c,v 1.22 2006/06/20 01:46:41 dgp85 Exp $
*
* pnm protocol implementation
* based upon code from joschka
@@ -126,14 +126,14 @@ const unsigned char pnm_data_header[]={
#define PNA_CLIENT_STRING 0x63
#define PNA_PATH_REQUEST 0x52
-const unsigned char pnm_challenge[] = "0990f6b4508b51e801bd6da011ad7b56";
-const unsigned char pnm_timestamp[] = "[15/06/1999:22:22:49 00:00]";
-const unsigned char pnm_guid[] = "3eac2411-83d5-11d2-f3ea-d7c3a51aa8b0";
-const unsigned char pnm_response[] = "97715a899cbe41cee00dd434851535bf";
-const unsigned char client_string[] = "WinNT_9.0_6.0.6.45_plus32_MP60_en-US_686l";
+static const char pnm_challenge[] = "0990f6b4508b51e801bd6da011ad7b56";
+static const char pnm_timestamp[] = "[15/06/1999:22:22:49 00:00]";
+static const char pnm_guid[] = "3eac2411-83d5-11d2-f3ea-d7c3a51aa8b0";
+static const char pnm_response[] = "97715a899cbe41cee00dd434851535bf";
+static const char client_string[] = "WinNT_9.0_6.0.6.45_plus32_MP60_en-US_686l";
#define PNM_HEADER_SIZE 11
-const unsigned char pnm_header[] = {
+static const unsigned char pnm_header[] = {
'P','N','A',
0x00, 0x0a,
0x00, 0x14,
@@ -141,7 +141,7 @@ const unsigned char pnm_header[] = {
0x00, 0x01 };
#define PNM_CLIENT_CAPS_SIZE 126
-const unsigned char pnm_client_caps[] = {
+static const unsigned char pnm_client_caps[] = {
0x07, 0x8a, 'p','n','r','v',
0, 0x90, 'p','n','r','v',
0, 0x64, 'd','n','e','t',
@@ -164,12 +164,12 @@ const unsigned char pnm_client_caps[] = {
0, 0x12, 'l','p','c','J',
0, 0x07, '0','5','_','6' };
-const uint32_t pnm_default_bandwidth=10485800;
-const uint32_t pnm_available_bandwidths[]={14400,19200,28800,33600,34430,57600,
+static const uint32_t pnm_default_bandwidth=10485800;
+static const uint32_t pnm_available_bandwidths[]={14400,19200,28800,33600,34430,57600,
115200,262200,393216,524300,1544000,10485800};
#define PNM_TWENTYFOUR_SIZE 16
-unsigned char pnm_twentyfour[]={
+static unsigned char pnm_twentyfour[]={
0xd5, 0x42, 0xa3, 0x1b, 0xef, 0x1f, 0x70, 0x24,
0x85, 0x29, 0xb3, 0x8d, 0xba, 0x11, 0xf3, 0xd6 };
@@ -361,7 +361,7 @@ static void pnm_send_request(pnm_t *p, uint32_t bandwidth) {
c+=pnm_write_chunk(PNA_CLIENT_CHALLANGE,strlen(pnm_challenge),
pnm_challenge,&p->buffer[c]);
c+=pnm_write_chunk(PNA_CLIENT_CAPS,PNM_CLIENT_CAPS_SIZE,
- pnm_client_caps,&p->buffer[c]);
+ (char*)pnm_client_caps,&p->buffer[c]);
c+=pnm_write_chunk(0x0a,0,NULL,&p->buffer[c]);
c+=pnm_write_chunk(0x0c,0,NULL,&p->buffer[c]);
c+=pnm_write_chunk(0x0d,0,NULL,&p->buffer[c]);
@@ -380,7 +380,7 @@ static void pnm_send_request(pnm_t *p, uint32_t bandwidth) {
c+=pnm_write_chunk(PNA_GUID,strlen(pnm_guid),
pnm_guid,&p->buffer[c]);
c+=pnm_write_chunk(PNA_TWENTYFOUR,PNM_TWENTYFOUR_SIZE,
- pnm_twentyfour,&p->buffer[c]);
+ (char*)pnm_twentyfour,&p->buffer[c]);
/* data after chunks */
memcpy(&p->buffer[c],after_chunks,after_chunks_length);
@@ -437,10 +437,10 @@ static void pnm_send_response(pnm_t *p, const char *response) {
static int pnm_get_headers(pnm_t *p, int *need_response) {
uint32_t chunk_type;
- uint8_t *ptr=p->header;
- uint8_t *prop_hdr=NULL;
+ char *ptr=(char*)p->header;
+ char *prop_hdr=NULL;
int chunk_size,size=0;
- int nr;
+ int nr =0;
/* rmff_header_t *h; */
*need_response=0;
@@ -578,7 +578,7 @@ static int pnm_calc_stream(pnm_t *p) {
static int pnm_get_stream_chunk(pnm_t *p) {
- int n;
+ unsigned int n;
char keepalive='!';
unsigned int fof1, fof2, stream;
@@ -665,7 +665,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
p->seq_current[0]=be2me_16(*(uint16_t*)(&p->buffer[5]));
/* now read the rest of stream chunk */
- n = _x_io_tcp_read (p->stream, p->s, &p->recv[5], fof1-5);
+ n = _x_io_tcp_read (p->stream, p->s, (char*)&p->recv[5], fof1-5);
if (n<(fof1-5)) return 0;
/* get second index */
@@ -706,7 +706,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) {
char *mrl_ptr=strdup(mrl);
char *slash, *colon;
- int pathbegin, hostend;
+ size_t pathbegin, hostend;
pnm_t *p;
int fd;
int need_response=0;
@@ -788,7 +788,7 @@ int pnm_read (pnm_t *this, char *data, int len) {
int to_copy=len;
char *dest=data;
- char *source=this->recv + this->recv_read;
+ char *source=(char*)(this->recv + this->recv_read);
int fill=this->recv_size - this->recv_read;
if (len < 0) return 0;
@@ -804,7 +804,7 @@ int pnm_read (pnm_t *this, char *data, int len) {
return len-to_copy;
}
- source = this->recv;
+ source = (char*)this->recv;
fill = this->recv_size - this->recv_read;
}