summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-07 02:26:13 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-07 02:34:35 +0300
commit0eb321bf2c1cc0e048faff26a01f86cdd3ec254f (patch)
tree71cb9bd9ed121156d3382066c0722c73189afe04 /stream
parent6d908205fbadbdf7ccdc6c5e0eb918f0b43f16e0 (diff)
downloadmpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.bz2
mpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.xz
Remove trailing whitespace from most files
Diffstat (limited to 'stream')
-rw-r--r--stream/ai_alsa.c10
-rw-r--r--stream/ai_alsa1x.c10
-rw-r--r--stream/ai_oss.c6
-rw-r--r--stream/asf_mmst_streaming.c112
-rw-r--r--stream/asf_streaming.c47
-rw-r--r--stream/audio_in.c4
-rw-r--r--stream/audio_in.h6
-rw-r--r--stream/cache2.c46
-rw-r--r--stream/cdd.h2
-rw-r--r--stream/cdinfo.c18
-rw-r--r--stream/cookies.c4
-rw-r--r--stream/cookies.h2
-rw-r--r--stream/dvb_tune.c18
-rw-r--r--stream/freesdp/common.h4
-rw-r--r--stream/freesdp/parser.c6
-rw-r--r--stream/freesdp/parser.h16
-rw-r--r--stream/freesdp/parserpriv.h10
-rw-r--r--stream/freesdp/priv.h4
-rw-r--r--stream/frequencies.c46
-rw-r--r--stream/frequencies.h4
-rw-r--r--stream/http.c42
-rw-r--r--stream/http.h2
-rw-r--r--stream/librtsp/rtsp.c88
-rw-r--r--stream/librtsp/rtsp.h4
-rw-r--r--stream/librtsp/rtsp_rtp.c64
-rw-r--r--stream/librtsp/rtsp_session.c18
-rw-r--r--stream/network.c20
-rw-r--r--stream/open.c3
-rw-r--r--stream/pnm.c122
-rw-r--r--stream/pnm.h2
-rw-r--r--stream/pvr.h2
-rw-r--r--stream/realrtsp/asmrp.c37
-rw-r--r--stream/realrtsp/real.c38
-rw-r--r--stream/realrtsp/real.h2
-rw-r--r--stream/realrtsp/rmff.c58
-rw-r--r--stream/realrtsp/rmff.h10
-rw-r--r--stream/realrtsp/sdpplin.c29
-rw-r--r--stream/realrtsp/sdpplin.h2
-rw-r--r--stream/realrtsp/xbuffer.c6
-rw-r--r--stream/realrtsp/xbuffer.h2
-rw-r--r--stream/rtp.c48
-rw-r--r--stream/stream.c24
-rw-r--r--stream/stream.h6
-rw-r--r--stream/stream_cdda.c16
-rw-r--r--stream/stream_cddb.c80
-rw-r--r--stream/stream_cue.c9
-rw-r--r--stream/stream_dvb.c56
-rw-r--r--stream/stream_dvd.c18
-rw-r--r--stream/stream_dvd_common.c2
-rw-r--r--stream/stream_dvdnav.c16
-rw-r--r--stream/stream_file.c4
-rw-r--r--stream/stream_ftp.c32
-rw-r--r--stream/stream_live555.c2
-rw-r--r--stream/stream_mf.c4
-rw-r--r--stream/stream_nemesi.c1
-rw-r--r--stream/stream_netstream.c22
-rw-r--r--stream/stream_netstream.h8
-rw-r--r--stream/stream_pvr.c170
-rw-r--r--stream/stream_radio.c27
-rw-r--r--stream/stream_rtp.c14
-rw-r--r--stream/stream_rtsp.c16
-rw-r--r--stream/stream_smb.c34
-rw-r--r--stream/stream_tv.c2
-rw-r--r--stream/stream_udp.c14
-rw-r--r--stream/stream_vcd.c6
-rw-r--r--stream/stream_vstream.c2
-rw-r--r--stream/tcp.c34
-rw-r--r--stream/tv.c2
-rw-r--r--stream/tv.h18
-rw-r--r--stream/tvi_bsdbt848.c90
-rw-r--r--stream/tvi_def.h4
-rw-r--r--stream/tvi_dshow.c88
-rw-r--r--stream/tvi_dshow.h4
-rw-r--r--stream/tvi_v4l.c6
-rw-r--r--stream/tvi_v4l2.c56
-rw-r--r--stream/tvi_vbi.c20
-rw-r--r--stream/udp.c4
-rw-r--r--stream/url.c18
-rw-r--r--stream/url.h2
-rw-r--r--stream/vcd_read.h6
-rw-r--r--stream/vcd_read_darwin.h28
81 files changed, 966 insertions, 973 deletions
diff --git a/stream/ai_alsa.c b/stream/ai_alsa.c
index 002ea36f71..e913dde099 100644
--- a/stream/ai_alsa.c
+++ b/stream/ai_alsa.c
@@ -105,19 +105,19 @@ int ai_alsa_setup(audio_in_t *ai)
int ai_alsa_init(audio_in_t *ai)
{
int err;
-
+
err = snd_pcm_open(&ai->alsa.handle, ai->alsa.device, SND_PCM_STREAM_CAPTURE, 0);
if (err < 0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "Error opening audio: %s\n", snd_strerror(err));
return -1;
}
-
+
err = snd_output_stdio_attach(&ai->alsa.log, stderr, 0);
-
+
if (err < 0) {
return -1;
}
-
+
err = ai_alsa_setup(ai);
return err;
@@ -139,7 +139,7 @@ int ai_alsa_xrun(audio_in_t *ai)
{
snd_pcm_status_t *status;
int res;
-
+
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(ai->alsa.handle, status))<0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA status error: %s", snd_strerror(res));
diff --git a/stream/ai_alsa1x.c b/stream/ai_alsa1x.c
index 625ccdf387..fa307a1cd8 100644
--- a/stream/ai_alsa1x.c
+++ b/stream/ai_alsa1x.c
@@ -119,19 +119,19 @@ int ai_alsa_setup(audio_in_t *ai)
int ai_alsa_init(audio_in_t *ai)
{
int err;
-
+
err = snd_pcm_open(&ai->alsa.handle, ai->alsa.device, SND_PCM_STREAM_CAPTURE, 0);
if (err < 0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "Error opening audio: %s\n", snd_strerror(err));
return -1;
}
-
+
err = snd_output_stdio_attach(&ai->alsa.log, stderr, 0);
-
+
if (err < 0) {
return -1;
}
-
+
err = ai_alsa_setup(ai);
return err;
@@ -153,7 +153,7 @@ int ai_alsa_xrun(audio_in_t *ai)
{
snd_pcm_status_t *status;
int res;
-
+
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(ai->alsa.handle, status))<0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA status error: %s", snd_strerror(res));
diff --git a/stream/ai_oss.c b/stream/ai_oss.c
index b662445128..d39454e855 100644
--- a/stream/ai_oss.c
+++ b/stream/ai_oss.c
@@ -75,11 +75,11 @@ int ai_oss_init(audio_in_t *ai)
ai->oss.device, strerror(errno));
return -1;
}
-
+
ioctl_param = 0 ;
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp getfmt: %d\n",
ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETFMTS, &ioctl_param));
-
+
mp_msg(MSGT_TV, MSGL_V, "Supported formats: %x\n", ioctl_param);
if (!(ioctl_param & AFMT_S16_LE))
mp_tmsg(MSGT_TV, MSGL_ERR, "unsupported format\n");
@@ -93,7 +93,7 @@ int ai_oss_init(audio_in_t *ai)
}
if (ai_oss_set_channels(ai) < 0) return -1;
-
+
ioctl_param = ai->req_samplerate;
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp speed: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SPEED, &ioctl_param));
diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c
index 65398c1602..ec6ba83264 100644
--- a/stream/asf_mmst_streaming.c
+++ b/stream/asf_mmst_streaming.c
@@ -69,7 +69,7 @@ extern int video_id;
#define HDR_BUF_SIZE 8192
#define MAX_STREAMS 20
-typedef struct
+typedef struct
{
uint8_t buf[BUF_SIZE];
int num_bytes;
@@ -82,7 +82,7 @@ static int stream_ids[MAX_STREAMS];
static int get_data (int s, char *buf, size_t count);
-static void put_32 (command_t *cmd, uint32_t value)
+static void put_32 (command_t *cmd, uint32_t value)
{
cmd->buf[cmd->num_bytes ] = value % 256;
value = value >> 8;
@@ -95,7 +95,7 @@ static void put_32 (command_t *cmd, uint32_t value)
cmd->num_bytes += 4;
}
-static uint32_t get_32 (unsigned char *cmd, int offset)
+static uint32_t get_32 (unsigned char *cmd, int offset)
{
uint32_t ret;
@@ -107,9 +107,9 @@ static uint32_t get_32 (unsigned char *cmd, int offset)
return ret;
}
-static void send_command (int s, int command, uint32_t switches,
+static void send_command (int s, int command, uint32_t switches,
uint32_t extra, int length,
- char *data)
+ char *data)
{
command_t cmd;
int len8;
@@ -175,7 +175,7 @@ static void string_utf16(char *dest, char *src, int len) {
#endif
}
-static void get_answer (int s)
+static void get_answer (int s)
{
char data[BUF_SIZE];
int command = 0x1b;
@@ -191,12 +191,12 @@ static void get_answer (int s)
command = get_32 (data, 36) & 0xFFFF;
- if (command == 0x1b)
+ if (command == 0x1b)
send_command (s, 0x1b, 0, 0, 0, data);
}
}
-static int get_data (int s, char *buf, size_t count)
+static int get_data (int s, char *buf, size_t count)
{
ssize_t len;
size_t total = 0;
@@ -223,7 +223,7 @@ static int get_data (int s, char *buf, size_t count)
}
-static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
+static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
{
unsigned char pre_header[8];
int header_len;
@@ -236,9 +236,9 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
return 0;
}
if (pre_header[4] == 0x02) {
-
+
int packet_len;
-
+
packet_len = (pre_header[7] << 8 | pre_header[6]) - 8;
// mp_msg(MSGT_NETWORK,MSGL_INFO,"asf header packet detected, len=%d\n", packet_len);
@@ -256,7 +256,7 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
header_len += packet_len;
if ( (header[header_len-1] == 1) && (header[header_len-2]==1)) {
-
+
if( streaming_bufferize( streaming_ctrl, header, header_len )<0 ) {
return -1;
@@ -266,7 +266,7 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
return header_len;
- }
+ }
} else {
@@ -278,9 +278,9 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"packet_len read failed.\n");
return 0;
}
-
+
packet_len = get_32 ((unsigned char*)&packet_len, 0) + 4;
-
+
// mp_msg(MSGT_NETWORK,MSGL_INFO,"command packet detected, len=%d\n", packet_len);
if (packet_len < 0 || packet_len > BUF_SIZE) {
@@ -288,26 +288,26 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
"Invalid RTSP packet size, giving up.\n");
return 0;
}
-
+
if (!get_data (s, data, packet_len)) {
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Command data read failed.\n");
return 0;
}
-
+
command = get_32 (data, 24) & 0xFFFF;
-
+
// mp_msg(MSGT_NETWORK,MSGL_INFO,"command: %02x\n", command);
-
- if (command == 0x1b)
+
+ if (command == 0x1b)
send_command (s, 0x1b, 0, 0, 0, data);
-
+
}
// mp_msg(MSGT_NETWORK,MSGL_INFO,"get header packet succ\n");
}
}
-static int interp_header (uint8_t *header, int header_len)
+static int interp_header (uint8_t *header, int header_len)
{
int i;
int packet_length=-1;
@@ -318,24 +318,24 @@ static int interp_header (uint8_t *header, int header_len)
i = 30;
while (i<header_len) {
-
+
uint64_t guid_1, guid_2, length;
- guid_2 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
+ guid_2 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
| ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24)
| ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40)
| ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56);
i += 8;
- guid_1 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
+ guid_1 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
| ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24)
| ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40)
| ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56);
i += 8;
-
+
// mp_msg(MSGT_NETWORK,MSGL_INFO,"guid found: %016llx%016llx\n", guid_1, guid_2);
- length = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
+ length = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8)
| ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24)
| ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40)
| ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56);
@@ -366,7 +366,7 @@ static int interp_header (uint8_t *header, int header_len)
} else {
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Too many IDs, stream skipped.");
}
-
+
} else {
#if 0
int b = i;
@@ -420,7 +420,7 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
mp_tmsg(MSGT_NETWORK, MSGL_FATAL, "Invalid RTSP packet size, giving up.\n");
return 0;
}
-
+
if (!get_data (s, data, packet_len)) {
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Media data read failed.\n");
return 0;
@@ -461,7 +461,7 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
// mp_msg(MSGT_NETWORK,MSGL_INFO,"\ncommand packet detected, len=%d cmd=0x%X\n", packet_len, command);
- if (command == 0x1b)
+ if (command == 0x1b)
send_command (s, 0x1b, 0, 0, 0, data);
else if (command == 0x1e) {
mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Everything done. Thank you for downloading a media file containing proprietary and patented technology.\n");
@@ -486,10 +486,10 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
static int packet_length1;
-static int asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl )
+static int asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl )
{
int len;
-
+
while( stream_ctrl->buffer_size==0 ) {
// buffer is empty - fill it!
int ret = get_media_packet( fd, packet_length1, stream_ctrl);
@@ -499,7 +499,7 @@ static int asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ct
} else if (ret==0) //EOF?
return ret;
}
-
+
len = stream_ctrl->buffer_size-stream_ctrl->buffer_pos;
if(len>size) len=size;
memcpy( buffer, (stream_ctrl->buffer)+(stream_ctrl->buffer_pos), len );
@@ -514,7 +514,7 @@ static int asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ct
}
-static int asf_mmst_streaming_seek( int fd, off_t pos, streaming_ctrl_t *streaming_ctrl )
+static int asf_mmst_streaming_seek( int fd, off_t pos, streaming_ctrl_t *streaming_ctrl )
{
return -1;
// Shut up gcc warning
@@ -538,7 +538,7 @@ int asf_mmst_streaming_start(stream_t *stream)
closesocket( stream->fd );
stream->fd = -1;
}
-
+
/* parse url */
path = strchr(url1->file,'/') + 1;
@@ -548,11 +548,11 @@ int asf_mmst_streaming_start(stream_t *stream)
unescpath=malloc(strlen(path)+1);
if (!unescpath) {
mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
- return -1;
+ return -1;
}
url_unescape_string(unescpath,path);
path=unescpath;
-
+
if( url1->port==0 ) {
url1->port=1755;
@@ -563,13 +563,13 @@ int asf_mmst_streaming_start(stream_t *stream)
return s;
}
mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Connected\n");
-
+
seq_num=0;
/*
- * Send the initial connect info including player version no. Client GUID (random) and the host address being connected to.
- * This command is sent at the very start of protocol initiation. It sends local information to the serve
- * cmd 1 0x01
+ * Send the initial connect info including player version no. Client GUID (random) and the host address being connected to.
+ * This command is sent at the very start of protocol initiation. It sends local information to the serve
+ * cmd 1 0x01
* */
/* prepare for the url encoding conversion */
@@ -588,7 +588,7 @@ int asf_mmst_streaming_start(stream_t *stream)
len = recv (s, data, BUF_SIZE, 0) ;
- /*This sends details of the local machine IP address to a Funnel system at the server.
+ /*This sends details of the local machine IP address to a Funnel system at the server.
* Also, the TCP or UDP transport selection is sent.
*
* here 192.168.0.1 is local ip address TCP/UDP states the tronsport we r using
@@ -612,8 +612,8 @@ int asf_mmst_streaming_start(stream_t *stream)
get_answer (s);
- /* The ASF header chunk request. Includes ?session' variable for pre header value.
- * After this command is sent,
+ /* The ASF header chunk request. Includes ?session' variable for pre header value.
+ * After this command is sent,
* the server replies with 0x11 command and then the header chunk with header data follows.
* 0x15 */
@@ -634,14 +634,14 @@ int asf_mmst_streaming_start(stream_t *stream)
packet_length = interp_header (asf_header, asf_header_len);
- /*
- * This command is the media stream MBR selector. Switches are always 6 bytes in length.
- * After all switch elements, data ends with bytes [00 00] 00 20 ac 40 [02].
- * Where:
- * [00 00] shows 0x61 0x00 (on the first 33 sent) or 0xff 0xff for ASF files, and with no ending data for WMV files.
- * It is not yet understood what all this means.
- * And the last [02] byte is probably the header ?session' value.
- *
+ /*
+ * This command is the media stream MBR selector. Switches are always 6 bytes in length.
+ * After all switch elements, data ends with bytes [00 00] 00 20 ac 40 [02].
+ * Where:
+ * [00 00] shows 0x61 0x00 (on the first 33 sent) or 0xff 0xff for ASF files, and with no ending data for WMV files.
+ * It is not yet understood what all this means.
+ * And the last [02] byte is probably the header ?session' value.
+ *
* 0x33 */
memset (data, 0, 40);
@@ -665,10 +665,10 @@ int asf_mmst_streaming_start(stream_t *stream)
get_answer (s);
- /* Start sending file from packet xx.
- * This