aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
committerGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
commit6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch)
tree0ed465592509105fdbeab27fc12ddbb2e3590aa5 /stream
parenteafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff)
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
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.c46
-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.c2
-rw-r--r--stream/pnm.c122
-rw-r--r--stream/pnm.h2
-rw-r--r--stream/pvr.h2
-rw-r--r--stream/realrtsp/asmrp.c36
-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.c28
-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.c8
-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_netstream.c22
-rw-r--r--stream/stream_netstream.h8
-rw-r--r--stream/stream_pvr.c170
-rw-r--r--stream/stream_radio.c26
-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
80 files changed, 966 insertions, 966 deletions
diff --git a/stream/ai_alsa.c b/stream/ai_alsa.c
index 84d0aa58a4..4371dd23ba 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio, 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatusError, snd_strerror(res));
diff --git a/stream/ai_alsa1x.c b/stream/ai_alsa1x.c
index aab42e397b..23e0b5d9ef 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio, 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatusError, snd_strerror(res));
diff --git a/stream/ai_oss.c b/stream/ai_oss.c
index bd7c7c312a..d2d2f20163 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_UnsupportedFmt);
@@ -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 c05ecb9240..0fb7179948 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_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_packet_lenReadFailed);
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)
MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize);
return 0;
}
-
+
if (!get_data (s, data, packet_len)) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_CmdDataReadFailed);
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_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_2ManyStreamID);
}
-
+
} 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_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize);
return 0;
}
-
+
if (!get_data (s, data, packet_len)) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_MediaDataReadFailed);
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_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_PatentedTechnologyJoke);
@@ -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_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
- 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_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_Connected);
-
+
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);
@@ -664,10 +664,10 @@ int asf_mmst_streaming_start(stream_t *stream)
get_answer (s);
- /* Start sending file from packet xx.
- * This command is also used for resume downloads or requesting a lost packet.
- * Also used for seeking by sending a play point value which seeks to the media time point.
- * Includes ?session' value in pre header and the maximum media stream time.
+ /* Start sending file from packet xx.
+ * This command is also used for resume downloads or requesting a lost packet.
+ * Also used for seeking by sending a play point value which seeks to the media time point.
+ * Includes ?session' value in pre header and the maximum media stream time.
* 0x07 */
memset (data, 0, 40);
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index c3e70a4aa2..517bb49f52 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -53,7 +53,7 @@ static int asf_read_wrapper(int fd, void *buffer, int len, streaming_ctrl_t *str
// internet connection, the TCP connection will not get
// through
// * Then we can try HTTP.
-//
+//
// Note: Using WMP sequence MMSU then MMST and then HTTP.
static int asf_streaming_start( stream_t *stream, int *demuxer_type) {
@@ -82,7 +82,7 @@ static int asf_streaming_start( stream_t *stream, int *demuxer_type) {
if( fd==-2 ) return -1;
}
- //Is protocol http, http_proxy, or mms?
+ //Is protocol http, http_proxy, or mms?
if (!strcasecmp(proto, "http_proxy") || !strcasecmp(proto, "http") ||
!strcasecmp(proto, "mms") || !strcasecmp(proto, "mmsh") ||
!strcasecmp(proto, "mmshttp"))
@@ -100,7 +100,7 @@ static int asf_streaming_start( stream_t *stream, int *demuxer_type) {
}
static int asf_streaming(ASF_stream_chunck_t *stream_chunck, int *drop_packet ) {
-/*
+/*
printf("ASF stream chunck size=%d\n", stream_chunck->size);
printf("length: %d\n", length );
printf("0x%02X\n", stream_chunck->type );
@@ -115,7 +115,7 @@ printf("0x%02X\n", stream_chunck->type );
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_SizeConfirmMismatch, stream_chunck->size, stream_chunck->size_confirm);
return -1;
}
-/*
+/*
printf(" type: 0x%02X\n", stream_chunck->type );
printf(" size: %d (0x%02X)\n", stream_chunck->size, stream_chunck->size );
printf(" sequence_number: 0x%04X\n", stream_chunck->sequence_number );
@@ -175,7 +175,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
int bw = streaming_ctrl->bandwidth;
int *v_rates = NULL, *a_rates = NULL;
int v_rate = 0, a_rate = 0, a_idx = -1, v_idx = -1;
-
+
if(asf_ctrl == NULL) return -1;
// The ASF header can be in several network chunks. For example if the content description
@@ -196,7 +196,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_NoHeaderAtFirstChunk);
return -1;
}
-
+
// audit: do not overflow buffer_size
if (size > SIZE_MAX - buffer_size) return -1;
buffer = malloc(size+buffer_size);
@@ -211,7 +211,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
chunk_buffer = buffer;
buffer += buffer_size;
buffer_size += size;
-
+
if (asf_read_wrapper(fd, buffer, size, streaming_ctrl) <= 0)
return -1;
@@ -227,9 +227,9 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
} while( buffer_size<chunk_size2read);
buffer = chunk_buffer;
size = buffer_size;
-
+
start = sizeof(ASF_header_t);
-
+
pos = find_asf_guid(buffer, asf_file_header_guid, start, size);
if (pos >= 0) {
ASF_file_header_t *fileh = (ASF_file_header_t *) &buffer[pos];
@@ -242,7 +242,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
}
*/
asf_ctrl->packet_size = AV_RL32(&fileh->max_packet_size);
- // before playing.
+ // before playing.
// preroll: time in ms to bufferize before playing
streaming_ctrl->prebuffer_size = (unsigned int)(((double)fileh->preroll/1000.0)*((double)fileh->max_bitrate/8.0));
}
@@ -289,7 +289,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
int stream_count;
char *ptr = &buffer[pos];
char *end = &buffer[size];
-
+
mp_msg(MSGT_NETWORK, MSGL_V, "Stream bitrate properties object\n");
if (ptr + 2 > end) goto len_err_out;
stream_count = AV_RL16(ptr);
@@ -354,7 +354,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
// find best audio stream
a_idx = max_idx(asf_ctrl->n_audio, a_rates, bw - v_rate);
-
+
free(v_rates);
free(a_rates);
@@ -403,7 +403,7 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct
if (rest == 0 && waiting == 0) {
if (asf_read_wrapper(fd, &chunk, sizeof(ASF_stream_chunck_t), streaming_ctrl) <= 0)
return -1;
-
+
// Endian handling of the stream chunk
le2me_ASF_stream_chunck_t(&chunk);
chunk_size = asf_streaming( &chunk, &drop_chunk );
@@ -412,7 +412,7 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct
return -1;
}
chunk_size -= sizeof(ASF_stream_chunck_t);
-
+
if(chunk.type != ASF_STREAMING_HEADER && (!drop_chunk)) {
if (asf_http_ctrl->packet_size < chunk_size) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrChunkBiggerThanPacket);
@@ -475,7 +475,7 @@ static int asf_http_streaming_type(char *content_type, char *features, HTTP_head
if( !strcasecmp(content_type, "application/octet-stream") ||
!strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") || // New in Corona, first request
!strcasecmp(content_type, "application/x-mms-framed") || // New in Corana, second request
- !strcasecmp(content_type, "video/x-ms-asf")) {
+ !strcasecmp(content_type, "video/x-ms-asf")) {
if( strstr(features, "broadcast") ) {
mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Live stream\n");
@@ -560,10 +560,10 @@ static HTTP_header_t *asf_http_request(streaming_ctrl_t *streaming_ctrl) {
http_set_uri( http_hdr, url->file );
sprintf( str, "Host: %.220s:%d", url->hostname, url->port );
}
-
+
http_set_field( http_hdr, str );
http_set_field( http_hdr, "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}" );
- sprintf(str,
+ sprintf(str,
"Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=%u:%u,request-context=%d,max-duration=%u",
offset_hi, offset_lo, asf_http_ctrl->request, length );
http_set_field( http_hdr, str );
@@ -645,7 +645,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT
char *comma_ptr=NULL;
char *end;
//printf("Pragma: [%s]\n", pragma );
- // The pragma line can get severals attributes
+ // The pragma line can get severals attributes
// separeted with a comma ','.
do {
if( !strncasecmp( pragma, "features=", 9) ) {
@@ -653,7 +653,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT
end = strstr( pragma, "," );
if( end==NULL ) {
len = strlen(pragma);
- } else {
+ } else {
len = (unsigned int)(end-pragma);
}
if(len > sizeof(features) - 1) {
@@ -718,7 +718,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
goto err_out;
}
i += r;
- }
+ }
http_free( http_hdr );
http_hdr = http_new_header();
do {
@@ -783,7 +783,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_UnknownASFStreamingType);
goto err_out;
}
- // Check if we got a redirect.
+ // Check if we got a redirect.
} while(!done);
stream->fd = fd;
@@ -820,7 +820,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
url = url_new(stream->url);
stream->streaming_ctrl->url = check4proxies(url);
url_free(url);
-
+
mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_MPDEMUX_ASF_InfoStreamASFURL, stream->url);
if((!strncmp(stream->url, "http", 4)) && (*file_format!=DEMUXER_TYPE_ASF && *file_format!=DEMUXER_TYPE_UNKNOWN)) {
streaming_ctrl_free(stream->streaming_ctrl);
@@ -834,7 +834,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
stream->streaming_ctrl = NULL;
return STREAM_UNSUPPORTED;
}
-
+
if (*file_format != DEMUXER_TYPE_PLAYLIST)
*file_format = DEMUXER_TYPE_ASF;
stream->type = STREAMTYPE_STREAM;
diff --git a/stream/audio_in.c b/stream/audio_in.c
index 45b1e9b79d..93513e9604 100644
--- a/stream/audio_in.c
+++ b/stream/audio_in.c
@@ -43,7 +43,7 @@ int audio_in_init(audio_in_t *ai, int type)
int audio_in_setup(audio_in_t *ai)
{
-
+
switch (ai->type) {
#ifdef CONFIG_ALSA
case AUDIO_IN_ALSA:
@@ -178,7 +178,7 @@ int audio_in_start_capture(audio_in_t *ai)
int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
{
int ret;
-
+
switch (ai->type) {
#ifdef CONFIG_ALSA
case AUDIO_IN_ALSA:
diff --git a/stream/audio_in.h b/stream/audio_in.h
index 855d613964..d59b3b6c89 100644
--- a/stream/audio_in.h
+++ b/stream/audio_in.h
@@ -27,11 +27,11 @@ typedef struct {
} ai_oss_t;
#endif
-typedef struct
+typedef struct
{
int type;
int setup;
-
+
/* requested values */
int req_channels;
int req_samplerate;
@@ -42,7 +42,7 @@ typedef struct
int blocksize;
int bytes_per_sample;
int samplesize;
-
+
#ifdef CONFIG_ALSA
ai_alsa_t alsa;
#endif
diff --git a/stream/cache2.c b/stream/cache2.c
index d211ba483b..acdb111f0b 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -86,7 +86,7 @@ int cache_read(cache_vars_t* s,unsigned char* buf,int size){
int pos,newb,len;
//printf("CACHE2_READ: 0x%X <= 0x%X <= 0x%X \n",s->min_filepos,s->read_filepos,s->max_filepos);
-
+
if(s->read_filepos>=s->max_filepos || s->read_filepos<s->min_filepos){
// eof?
if(s->eof) break;
@@ -106,21 +106,21 @@ int cache_read(cache_vars_t* s,unsigned char* buf,int size){
if(newb>s->buffer_size-pos) newb=s->buffer_size-pos; // handle wrap...
if(newb>size) newb=size;
-
+
// check:
if(s->read_filepos<s->min_filepos) mp_msg(MSGT_CACHE,MSGL_ERR,"Ehh. s->read_filepos<s->min_filepos !!! Report bug...\n");
-
+
// len=write(mem,newb)
//printf("Buffer read: %d bytes\n",newb);
memcpy(buf,&s->buffer[pos],newb);
buf+=newb;
len=newb;
// ...
-
+
s->read_filepos+=len;
size-=len;
total+=len;
-
+
}
cache_fill_status=(s->max_filepos-s->read_filepos)/(s->buffer_size / 100);
return total;
@@ -129,7 +129,7 @@ int cache_read(cache_vars_t* s,unsigned char* buf,int size){
int cache_fill(cache_vars_t* s){
int back,back2,newb,space,len,pos;
off_t read=s->read_filepos;
-
+
if(read<s->min_filepos || read>s->max_filepos){
// seek...
mp_msg(MSGT_CACHE,MSGL_DBG2,"Out of boundaries... seeking to 0x%"PRIX64" \n",(int64_t)read);
@@ -144,36 +144,36 @@ int cache_fill(cache_vars_t* s){
mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%"PRIX64" \n",(int64_t)stream_tell(s->stream));
}
}
-
+
// calc number of back-bytes:
back=read - s->min_filepos;
if(back<0) back=0; // strange...
if(back>s->back_size) back=s->back_size;
-
+
// calc number of new bytes:
newb=s->max_filepos - read;
if(newb<0) newb=0; // strange...
// calc free buffer space:
space=s->buffer_size - (newb+back);
-
+
// calc bufferpos:
pos=s->max_filepos - s->offset;
if(pos>=s->buffer_size) pos-=s->buffer_size; // wrap-around
-
+
if(space<s->fill_limit){
// printf("Buffer is full (%d bytes free, limit: %d)\n",space,s->fill_limit);
return 0; // no fill...
}
// printf("### read=0x%X back=%d newb=%d space=%d pos=%d\n",read,back,newb,space,pos);
-
+
// reduce space if needed:
if(space>s->buffer_size-pos) space=s->buffer_size-pos;
-
+
// if(space>32768) space=32768; // limit one-time block size
if(space>4*s->sector_size) space=4*s->sector_size;
-
+
// if(s->seek_lock) return 0; // FIXME
#if 1
@@ -183,7 +183,7 @@ int cache_fill(cache_vars_t* s){
#else
s->min_filepos=read-back; // avoid seeking-back to temp area...
#endif
-
+
// ....
//printf("Buffer fill: %d bytes of %d\n",space,s->buffer_size);
//len=stream_fill_buffer(s->stream);
@@ -191,15 +191,15 @@ int cache_fill(cache_vars_t* s){
// ....
len=stream_read(s->stream,&s->buffer[pos],space);
if(!len) s->eof=1;
-
+
s->max_filepos+=len;
if(pos+len>=s->buffer_size){
// wrap...
s->offset+=s->buffer_size;
}
-
+
return len;
-
+
}
static int cache_execute_control(cache_vars_t *s) {
@@ -254,7 +254,7 @@ cache_vars_t* cache_init(int size,int sector){
cache_vars_t* s=malloc(sizeof(cache_vars_t));
#endif
if(s==NULL) return NULL;
-
+
memset(s,0,sizeof(cache_vars_t));
num=size/sector;
if(num < 16){
@@ -332,7 +332,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
if (min > s->buffer_size - s->fill_limit) {
min = s->buffer_size - s->fill_limit;
}
-
+
#if !defined(__MINGW32__) && !defined(PTHREAD_CACHE) && !defined(__OS2__)
if((stream->cache_pid=fork())){
#else
@@ -367,7 +367,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
mp_msg(MSGT_CACHE,MSGL_STATUS,"\n");
return 1; // parent exits
}
-
+
#if defined(__MINGW32__) || defined(PTHREAD_CACHE) || defined(__OS2__)
}
#ifdef PTHREAD_CACHE
@@ -376,7 +376,7 @@ static void *ThreadProc( void *s ){
static void ThreadProc( void *s ){
#endif
#endif
-
+
#ifdef CONFIG_GUI
use_gui = 0; // mp_msg may not use gui stuff in forked code
#endif
@@ -421,10 +421,10 @@ int cache_stream_seek_long(stream_t *stream,off_t pos){
cache_vars_t* s;
off_t newpos;
if(!stream->cache_pid) return stream_seek_long(stream,pos);
-
+
s=stream->cache_data;
// s->seek_lock=1;
-
+
mp_msg(MSGT_CACHE,MSGL_DBG2,"CACHE2_SEEK: 0x%"PRIX64" <= 0x%"PRIX64" (0x%"PRIX64") <= 0x%"PRIX64" \n",s->min_filepos,pos,s->read_filepos,s->max_filepos);
newpos=pos/s->sector_size; newpos*=s->sector_size; // align
diff --git a/stream/cdd.h b/stream/cdd.h
index 1208684769..97c039b3d0 100644
--- a/stream/cdd.h
+++ b/stream/cdd.h
@@ -11,7 +11,7 @@
#endif
typedef struct {
- char cddb_hello[1024];
+ char cddb_hello[1024];
unsigned long disc_id;
unsigned int tracks;
char *cache_dir;
diff --git a/stream/cdinfo.c b/stream/cdinfo.c
index 4f576c98b9..6e4544d366 100644
--- a/stream/cdinfo.c
+++ b/stream/cdinfo.c
@@ -1,5 +1,5 @@
/*
- * CD Info
+ * CD Info
* by Bertrand Baudet <bertrand_baudet@yahoo.com>
* (C) 2002, MPlayer team.
*/
@@ -22,15 +22,15 @@
cd_info_t*
cd_info_new(void) {
cd_info_t *cd_info = NULL;
-
+
cd_info = malloc(sizeof(cd_info_t));
if( cd_info==NULL ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
return NULL;
}
-
+
memset(cd_info, 0, sizeof(cd_info_t));
-
+
return cd_info;
}
@@ -54,16 +54,16 @@ cd_info_free(cd_info_t *cd_info) {
cd_track_t*
cd_info_add_track(cd_info_t *cd_info, char *track_name, unsigned int track_nb, unsigned int min, unsigned int sec, unsigned int msec, unsigned long frame_begin, unsigned long frame_length) {
cd_track_t *cd_track;
-
+
if( cd_info==NULL || track_name==NULL ) return NULL;
-
+
cd_track = malloc(sizeof(cd_track_t));
if( cd_track==NULL ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
return NULL;
}
memset(cd_track, 0, sizeof(cd_track_t));
-
+
cd_track->name = malloc(strlen(track_name)+1);
if( cd_track->name==NULL ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
@@ -86,12 +86,12 @@ cd_info_add_track(cd_info_t *cd_info, char *track_name, unsigned int track_nb, u
}
cd_track->prev = cd_info->last;
-
+
cd_info->last = cd_track;
cd_info->current = cd_track;
cd_info->nb_tracks++;
-
+
return cd_track;
}
diff --git a/stream/cookies.c b/stream/cookies.c
index ea46c42419..40a5b16097 100644
--- a/stream/cookies.c
+++ b/stream/cookies.c
@@ -191,8 +191,8 @@ static struct cookie_list_type *load_cookies(void)
if (dir) {
while ((ent = readdir(dir)) != NULL) {
if ((ent->d_name)[0] != '.') {
- buf = malloc(strlen(getenv("HOME")) +
- sizeof("/.mozilla/default/") +
+ buf = malloc(strlen(getenv("HOME")) +
+ sizeof("/.mozilla/default/") +
strlen(ent->d_name) + sizeof("cookies.txt") + 1);
sprintf(buf, "%s/.mozilla/default/%s/cookies.txt",
getenv("HOME"), ent->d_name);
diff --git a/stream/cookies.h b/stream/cookies.h
index f4c2a0525e..bbfb9f0598 100644
--- a/stream/cookies.h
+++ b/stream/cookies.h
@@ -1,7 +1,7 @@
/*
* HTTP Cookies
* Reads Netscape and Mozilla cookies.txt files
- *
+ *
* by Dave Lambley <mplayer@davel.me.uk>
*/
diff --git a/stream/dvb_tune.c b/stream/dvb_tune.c
index b631e13e73..8b7bdb7317 100644
--- a/stream/dvb_tune.c
+++ b/stream/dvb_tune.c
@@ -165,7 +165,7 @@ int dvb_fix_demuxes(dvb_priv_t *priv, int cnt)
#else
sprintf(demux_dev, "/dev/ost/demux%d", priv->card);
#endif
-
+
mp_msg(MSGT_DEMUX, MSGL_V, "FIX %d -> %d\n", priv->demux_fds_cnt, cnt);
if(priv->demux_fds_cnt >= cnt)
{
@@ -189,9 +189,9 @@ int dvb_fix_demuxes(dvb_priv_t *priv, int cnt)
}
else
priv->demux_fds_cnt++;
- }
+ }
}
-
+
return 1;
}
@@ -396,7 +396,7 @@ static int check_status(int fd_frontend, int tmout)
strength=0;
if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0)
mp_msg(MSGT_DEMUX, MSGL_V, "UNC: %d\n",strength);
-
+
print_status(festatus);
}
else
@@ -415,7 +415,7 @@ static int check_status(int fd_frontend, int tmout)
int32_t strength;
fe_status_t festatus;
FrontendEvent event;
-
+
struct pollfd pfd[1];
i = 0; res = -1;
@@ -484,12 +484,12 @@ static int check_status(int fd_frontend, int tmout)
festatus=0;
mp_msg(MSGT_DEMUX, MSGL_V, "FE_STATUS:");
-
+
if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0)
print_status(festatus);
else
mp_msg(MSGT_DEMUX, MSGL_ERR, " ERROR, UNABLE TO READ_STATUS");
-
+
mp_msg(MSGT_DEMUX, MSGL_V, "\n");
}
else
@@ -568,14 +568,14 @@ static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo)
scmd.u.diseqc.params[0] = 0xf0 |
(((sat_no) << 2) & 0x0F) |
(hi_lo ? 1 : 0) |
- (polv ? 0 : 2);
+ (polv ? 0 : 2);
if (ioctl(secfd,SEC_SEND_SEQUENCE,&scmds) < 0)
{
mp_msg(MSGT_DEMUX, MSGL_ERR, "Error sending DisEqC");
return -1;
}
-
+
return 0;
}
#endif
diff --git a/stream/freesdp/common.h b/stream/freesdp/common.h
index ae59406049..bd051a57a7 100644
--- a/stream/freesdp/common.h
+++ b/stream/freesdp/common.h
@@ -127,7 +127,7 @@ typedef enum
} fsdp_error_t;
/**
- * @short Type of network
+ * @short Type of network
*
* Initially, SDP defines "Internet". New network types may be
* registered with IANA. However, the number of types is expected to
@@ -154,7 +154,7 @@ typedef enum
} fsdp_address_type_t;
/**
- * @short Type of bandwith modifiers
+ * @short Type of bandwith modifiers
*
* Bandwidth modifiers specify the meaning of the bandwidth
* value. Initially "Conference Total" and "Application Specific" are
diff --git a/stream/freesdp/parser.c b/stream/freesdp/parser.c
index bf6f985e94..34e6737a05 100644
--- a/stream/freesdp/parser.c
+++ b/stream/freesdp/parser.c
@@ -1,7 +1,7 @@
/*
This file is part of FreeSDP
Copyright (C) 2001,2002,2003 Federico Montesino Pouzols <fedemp@altern.org>
-
+
FreeSDP is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -380,7 +380,7 @@ fsdp_parse (const char *text_description, fsdp_description_t * dsc)
}
/* `k=' line (encryption key) [optional] */
- /* k=<method>
+ /* k=<method>
k=<method>:<encryption key> */
result = fsdp_parse_k (&p, &(dsc->k_encryption_method),
&(dsc->k_encryption_content));
@@ -687,7 +687,7 @@ fsdp_parse (const char *text_description, fsdp_description_t * dsc)
return result;
/* `k=' line (encryption key) [optional] */
- /* k=<method>
+ /* k=<method>
k=<method>:<encryption key> */
result = fsdp_parse_k (&p, &(media->k_encryption_method),
&(media->k_encryption_content));
diff --git a/stream/freesdp/parser.h b/stream/freesdp/parser.h
index 80c61d0115..76d10adb5b 100644
--- a/stream/freesdp/parser.h
+++ b/stream/freesdp/parser.h
@@ -46,7 +46,7 @@ BEGIN_C_DECLS
* functions.
*
* @param description a multimedia session description formatted in
- * SDP.
+ * SDP.
* @param dsc pointer that is updated to point to a fsdp_description_t
* object. This fsdp_description_t object should have been previously
* allocated using <code>fsdp_description_new()</code>; to free it,
@@ -60,12 +60,12 @@ fsdp_error_t fsdp_parse (const char *description, fsdp_description_t * dsc);
/**
* Get the SDP protocol version of the description.
*
- * @return SDP protocol version number.
+ * @return SDP protocol version number.
**/
unsigned int fsdp_get_version (const fsdp_description_t * dsc);
/**
- * Get the username provided by the originator of the session.
+ * Get the username provided by the originator of the session.
*
* @param dsc SDP description object.
* @return username of the session owner
@@ -73,7 +73,7 @@ unsigned int fsdp_get_version (const fsdp_description_t * dsc);
const char *fsdp_get_owner_username (const fsdp_description_t * dsc);
/**
- * Get the id for the session described in <code>dsc</code>.
+ * Get the id for the session described in <code>dsc</code>.
*
* @param dsc SDP description object.
* @return id string for this session.
@@ -241,7 +241,7 @@ unsigned int fsdp_get_bw_modifier_count (const fsdp_description_t * dsc);
* @param dsc SDP description object.
* @param index number of bandwidth modifier.
*
- * @return global bandwidth modifier type.
+ * @return global bandwidth modifier type.
* @retval FSDP_BW_MOD_TYPE_UNDEFINED if no global bandwith modifier
* type is defined or invalid index.
* @retval FSDP_BW_MOD_TYPE_UNKNOWN if an unknown bandwith modifier is
@@ -254,7 +254,7 @@ fsdp_get_bw_modifier_type (const fsdp_description_t * dsc,
unsigned int index);
/**
- * Get the textual bandwidth modifier type when it is unknown.
+ * Get the textual bandwidth modifier type when it is unknown.
*
* @param dsc SDP description object.
* @param index number of bandwidth modifier.
@@ -267,7 +267,7 @@ const char *fsdp_get_bw_modifier_type_unknown (const fsdp_description_t * dsc,
unsigned int index);
/**
- * Get the value for the bandwidth modifier.
+ * Get the value for the bandwidth modifier.
*
* @param dsc SDP description object.
* @param index number of bandwidth modifier.
@@ -474,7 +474,7 @@ unsigned int fsdp_get_sdplang_count (const fsdp_description_t * dsc);
const char *fsdp_get_sdplang (const fsdp_description_t * dsc,
unsigned int index);
-/**
+/**
* Get the mode of the conference, specified with attributes sendrecv,
* sendonly, recvonly and inactive.
*
diff --git a/stream/freesdp/parserpriv.h b/stream/freesdp/parserpriv.h
index 9d44102d31..b6762a4d55 100644
--- a/stream/freesdp/parserpriv.h
+++ b/stream/freesdp/parserpriv.h
@@ -33,12 +33,12 @@
* Parse a connection (c=<network type> <address type> <connection
* address>) line. If the textual description in <code>p</code> begins
* with a connection line, it is parsed. If not, nothing is done.
- *
+ *
* @param p fraction of textual SDP description.
* @param ntype where to store the network type.
* @param atype where to store the address type.
* @param address where to store the connection address as a string.
- *
+ *
* @return parse error code.
**/
static fsdp_error_t
@@ -51,7 +51,7 @@ fsdp_parse_c (const char **p, fsdp_network_type_t * ntype,
* textual description in <code>p</code> begins with a bandwidth line,
* it is parsed as well as all b lines inmediately after it. If not,
* nothing is done.
- *
+ *
* @param p fraction of textual SDP description.
* @param bw_modifiers pointer to empty array of bandwidth modifiers to fill.
* @param bw_modifiers_count where to set the number of bandwidth
@@ -96,11 +96,11 @@ static fsdp_error_t
fsdp_parse_rtpmap (fsdp_rtpmap_t *** rtpmap, unsigned int *counter,
const char *value);
-/**
+/**
* Maximun default field len for "expected to be short" fields, like
* username, session_id or inet addresses.
*
- * MDFLENS value must be MAXSHORTFIELDLEN - 1
+ * MDFLENS value must be MAXSHORTFIELDLEN - 1
**/
#define MAXSHORTFIELDLEN 96
#define MSFLENS "95"
diff --git a/stream/freesdp/priv.h b/stream/freesdp/priv.h
index 4a16830356..07d6e3dfb3 100644
--- a/stream/freesdp/priv.h
+++ b/stream/freesdp/priv.h
@@ -51,13 +51,13 @@
/**
* @example formatdemo.c
- *
+ *
* A basic SDP descriptions formatter based on FreeSDP.
**/
/**
* @example parsedemo.c
- *
+ *
* A basic SDP descriptions parser based on FreeSDP.
**/
diff --git a/stream/frequencies.c b/stream/frequencies.c
index 122cbbfe5e..5d8fe9b66a 100644
--- a/stream/frequencies.c
+++ b/stream/frequencies.c
@@ -75,7 +75,7 @@ static const struct CHANLIST ntsc_bcast[] = {
{ "67", 789250 },
{ "68", 795250 },
{ "69", 801250 },
-
+
{ "70", 807250 },
{ "71", 813250 },
{ "72", 819250 },
@@ -115,7 +115,7 @@ static const struct CHANLIST ntsc_cable[] = {
{ "18", 145250 },
{ "19", 151250 },
{ "20", 157250 },
-
+
{ "21", 163250 },
{ "22", 169250 },
{ "23", 217250 },
@@ -165,7 +165,7 @@ static const struct CHANLIST ntsc_cable[] = {
{ "67", 481250 },
{ "68", 487250 },
{ "69", 493250 },
-
+
{ "70", 499250 },
{ "71", 505250 },
{ "72", 511250 },
@@ -222,7 +222,7 @@ static const struct CHANLIST ntsc_cable[] = {
{ "123", 787250 },
{ "124", 793250 },
{ "125", 799250 },
-
+
{ "T7", 8250 },
{ "T8", 14250 },
{ "T9", 20250 },
@@ -236,11 +236,11 @@ static const struct CHANLIST ntsc_cable[] = {
/* US HRC */
static const struct CHANLIST ntsc_hrc[] = {
{ "1", 72000 },
- { "2", 54000 },
- { "3", 60000 },
- { "4", 66000 },
- { "5", 78000 },
- { "6", 84000 },
+ { "2", 54000 },
+ { "3", 60000 },
+ { "4", 66000 },
+ { "5", 78000 },
+ { "6", 84000 },
{ "7", 174000 },
{ "8", 180000 },
{ "9", 186000 },
@@ -256,7 +256,7 @@ static const struct CHANLIST ntsc_hrc[] = {
{ "18", 144000 },
{ "19", 150000 },
{ "20", 156000 },
-
+
{ "21", 162000 },
{ "22", 168000 },
{ "23", 216000 },
@@ -306,7 +306,7 @@ static const struct CHANLIST ntsc_hrc[] = {
{ "67", 480000 },
{ "68", 486000 },
{ "69", 492000 },
-
+
{ "70", 498000 },
{ "71", 504000 },
{ "72", 510000 },
@@ -363,15 +363,15 @@ static const struct CHANLIST ntsc_hrc[] = {
{ "123", 786000 },
{ "124", 792000 },
{ "125", 798000 },
-
- { "T7", 7000 },
- { "T8", 13000 },
- { "T9", 19000 },
- { "T10", 25000 },
- { "T11", 31000 },
- { "T12", 37000 },
- { "T13", 43000 },
- { "T14", 49000 },
+
+ { "T7", 7000 },
+ { "T8", 13000 },
+ { "T9", 19000 },
+ { "T10", 25000 },
+ { "T11", 31000 },
+ { "T12", 37000 },
+ { "T13", 43000 },
+ { "T14", 49000 },
};
/* --------------------------------------------------------------------- */
@@ -454,7 +454,7 @@ static const struct CHANLIST ntsc_cable_jp[] = {
{ "18", 139250 },
{ "19", 145250 },
{ "20", 151250 },
-
+
{ "21", 157250 },
{ "22", 165250 },
{ "23", 223250 },
@@ -840,8 +840,8 @@ static const struct CHANLIST secam_france[] = {
/* --------------------------------------------------------------------- */
static const struct CHANLIST pal_newzealand[] = {
- { "1", 45250 },
- { "2", 55250 },
+ { "1", 45250 },
+ { "2", 55250 },
{ "3", 62250 },
{ "4", 175250 },
{ "5", 182250 },
diff --git a/stream/frequencies.h b/stream/frequencies.h
index bf822d468b..25795a4899 100644
--- a/stream/frequencies.h
+++ b/stream/frequencies.h
@@ -3,7 +3,7 @@
*
* Nathan Laredo (laredo@broked.net)
*
- * Frequencies are given in kHz
+ * Frequencies are given in kHz
*/
#ifndef MPLAYER_FREQUENCIES_H
@@ -20,7 +20,7 @@
containing 8 bits frame sync, 5 bits control, 11 bits additional data, and
704 bits audio data. The bit rate is reduced by transmitting only 10 bits
plus parity of each 14 bit sample, the largest sample in a frame determines
- which 10 bits are transmitted. The parity bits for audio samples also
+ which 10 bits are transmitted. The parity bits for audio samples also
specify the scaling factor used for that channel during that frame. The
companeded audio data is interleaved to reduce the influence of dropouts
and the whole frame except for sync bits is scrambled for spectrum shaping.
diff --git a/stream/http.c b/stream/http.c
index 3286591943..498e40473c 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -1,4 +1,4 @@
-/*
+/*
* HTTP Helper
* by Bertrand Baudet <bertrand_baudet@yahoo.com>
* (C) 2001, MPlayer team.
@@ -204,7 +204,7 @@ static int nop_streaming_start( stream_t *stream ) {
fd = stream->fd;
if( fd<0 ) {
- fd = http_send_request( stream->streaming_ctrl->url, 0 );
+ fd = http_send_request( stream->streaming_ctrl->url, 0 );
if( fd<0 ) return -1;
http_hdr = http_read_response( fd );
if( http_hdr==NULL ) return -1;
@@ -233,7 +233,7 @@ static int nop_streaming_start( stream_t *stream ) {
if (next_url != NULL && rd_url != NULL) {
mp_msg(MSGT_NETWORK,MSGL_STATUS,"Redirected: Using this url instead %s\n",next_url);
stream->streaming_ctrl->url=check4proxies(rd_url);
- ret=nop_streaming_start(stream); //recursively get streaming started
+ ret=nop_streaming_start(stream); //recursively get streaming started
} else {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Redirection failed\n");
closesocket( fd );
@@ -333,7 +333,7 @@ int
http_is_header_entire( HTTP_header_t *http_hdr ) {
if( http_hdr==NULL ) return -1;
if( http_hdr->buffer==NULL ) return 0; // empty
-
+
if( strstr(http_hdr->buffer, "\r\n\r\n")==NULL &&
strstr(http_hdr->buffer, "\n\n")==NULL ) return 0;
return 1;
@@ -424,7 +424,7 @@ http_response_parse( HTTP_header_t *http_hdr ) {
http_set_field( http_hdr, field );
hdr_ptr = ptr+((*ptr=='\r')?2:1);
} while( hdr_ptr<(http_hdr->buffer+pos_hdr_sep) );
-
+
if( field!=NULL ) free( field );
if( pos_hdr_sep+hdr_sep_len<http_hdr->buffer_size ) {
@@ -459,7 +459,7 @@ http_build_request( HTTP_header_t *http_hdr ) {
// Add the Method line
len = strlen(http_hdr->method)+strlen(uri)+12;
// Add the fields
- field = http_hdr->first_field;
+ field = http_hdr->first_field;
while( field!=NULL ) {
len += strlen(field->field_name)+2;
field = field->next;
@@ -499,7 +499,7 @@ http_build_request( HTTP_header_t *http_hdr ) {
}
if( uri ) free( uri );
- return http_hdr->buffer;
+ return http_hdr->buffer;
}
char *
@@ -522,7 +522,7 @@ http_get_next_field( HTTP_header_t *http_hdr ) {
if( http_hdr==NULL ) return NULL;
field = http_hdr->field_search_pos;
- while( field!=NULL ) {
+ while( field!=NULL ) {
ptr = strstr( field->field_name, ":" );
if( ptr==NULL ) return NULL;
if( !strncasecmp( field->field_name, http_hdr->field_search, ptr-(field->field_name) ) ) {
@@ -598,7 +598,7 @@ http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, co
if( password!=NULL ) {
pass_len = strlen(password);
}
-
+
usr_pass = malloc(strlen(username)+pass_len+2);
if( usr_pass==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
@@ -622,22 +622,22 @@ http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, co
}
b64_usr_pass[out_len]='\0';
-
+
auth = malloc(encoded_len+22);
if( auth==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
goto out;
}
-
+
sprintf( auth, "Authorization: Basic %s", b64_usr_pass);
http_set_field( http_hdr, auth );
res = 0;
-
+
out:
free( usr_pass );
free( b64_usr_pass );
free( auth );
-
+
return res;
}
@@ -665,7 +665,7 @@ http_debug_hdr( HTTP_header_t *http_hdr ) {
mp_msg(MSGT_NETWORK,MSGL_V,"--- HTTP DEBUG HEADER --- END ---\n");
}
-int
+int
base64_encode(const void *enc, int encLen, char *out, int outMax) {
static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -764,7 +764,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
http_debug_hdr( http_hdr );
}
-
+
// Check if we can make partial content requests and thus seek in http-streams
if( http_hdr!=NULL && http_hdr->status_code==200 ) {
char *accept_ranges;
@@ -780,8 +780,8 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
switch( http_hdr->status_code ) {
case 200: { // OK
char *field_data;
- // If content-type == video/nsv we most likely have a winamp video stream
- // otherwise it should be mp3. if there are more types consider adding mime type
+ // If content-type == video/nsv we most likely have a winamp video stream
+ // otherwise it should be mp3. if there are more types consider adding mime type
// handling like later
if ( (field_data = http_get_field(http_hdr, "content-type")) != NULL && (!strcmp(field_data, "video/nsv") || !strcmp(field_data, "misc/ultravox")))
*file_format = DEMUXER_TYPE_NSV;
@@ -810,7 +810,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
}
}
- // Assume standard http if not ICY
+ // Assume standard http if not ICY
switch( http_hdr->status_code ) {
case 200: // OK
// Look if we can use the Content-Type
@@ -858,7 +858,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
free(url->protocol);
url->protocol = strdup("unsv");
}
- redirect = 1;
+ redirect = 1;
}
break;
case 401: // Authentication required
@@ -922,7 +922,7 @@ static int open_s1(stream_t *stream,int mode, void* opts, int* file_format) {
url = url_new(stream->url);
stream->streaming_ctrl->url = check4proxies(url);
url_free(url);
-
+
mp_msg(MSGT_OPEN, MSGL_V, "STREAM_HTTP(1), URL: %s\n", stream->url);
seekable = http_streaming_start(stream, file_format);
if((seekable < 0) || (*file_format == DEMUXER_TYPE_ASF)) {
@@ -951,7 +951,7 @@ static int open_s2(stream_t *stream,int mode, void* opts, int* file_format) {
url = url_new(stream->url);
stream->streaming_ctrl->url = check4proxies(url);
url_free(url);
-
+
mp_msg(MSGT_OPEN, MSGL_V, "STREAM_HTTP(2), URL: %s\n", stream->url);
seekable = http_streaming_start(stream, file_format);
if(seekable < 0) {
diff --git a/stream/http.h b/stream/http.h
index 345dd5bfb9..849ebf06a3 100644
--- a/stream/http.h
+++ b/stream/http.h
@@ -1,4 +1,4 @@
-/*
+/*
* HTTP Helper
* by Bertrand Baudet <bertrand_baudet@yahoo.com>
* (C) 2001, MPlayer team.
diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c
index 8012174d99..53ed233c53 100644
--- a/stream/librtsp/rtsp.c
+++ b/stream/librtsp/rtsp.c
@@ -59,12 +59,12 @@
/*
* network utilities
*/
-
+
static int write_stream(int s, const char *buf, int len) {
int total, timeout;
total = 0; timeout = 30;
- while (total < len){
+ while (total < len){
int n;
n = send (s, &buf[total], len - total, 0);
@@ -87,37 +87,37 @@ static int write_stream(int s, const char *buf, int len) {
}
static ssize_t read_stream(int fd, void *buf, size_t count) {
-
+
ssize_t ret, total;
total = 0;
while (total < count) {
-
+
ret=recv (fd, ((uint8_t*)buf)+total, count-total, 0);
if (ret<0) {
if(errno == EAGAIN) {
fd_set rset;
struct timeval timeout;
-
+
FD_ZERO (&rset);
FD_SET (fd, &rset);
-
+
timeout.tv_sec = 30;
timeout.tv_usec = 0;
-
+
if (select (fd+1, &rset, NULL, NULL, &timeout) <= 0) {
return -1;
}
continue;
}
-
+
mp_msg(MSGT_OPEN, MSGL_ERR, "rtsp: read error.\n");
return ret;
} else
total += ret;
-
+
/* end of stream */
if (!ret) break;
}
@@ -129,7 +129,7 @@ static ssize_t read_stream(int fd, void *buf, size_t count) {
* rtsp_get gets a line from stream
* and returns a null terminated string.
*/
-
+
static char *rtsp_get(rtsp_t *s) {
int n=1;
@@ -154,7 +154,7 @@ static char *rtsp_get(rtsp_t *s) {
#ifdef LOG
mp_msg(MSGT_OPEN, MSGL_INFO, "librtsp: << '%s'\n", string);
#endif
-
+
free(buffer);
return string;
@@ -163,7 +163,7 @@ static char *rtsp_get(rtsp_t *s) {
/*
* rtsp_put puts a line on stream
*/
-
+
static void rtsp_put(rtsp_t *s, const char *string) {
int len=strlen(string);
@@ -178,7 +178,7 @@ static void rtsp_put(rtsp_t *s, const char *string) {
buf[len+1]=0x0a;
write_stream(s->s, buf, len+2);
-
+
#ifdef LOG
mp_msg(MSGT_OPEN, MSGL_INFO, " done.\n");
#endif
@@ -194,7 +194,7 @@ static int rtsp_get_code(const char *string) {
char buf[4];
int code=0;
-
+
if (!strncmp(string, RTSP_PROTOCOL_VERSION, strlen(RTSP_PROTOCOL_VERSION)))
{
memcpy(buf, string+strlen(RTSP_PROTOCOL_VERSION)+1, 3);
@@ -218,9 +218,9 @@ static void rtsp_send_request(rtsp_t *s, const char *type, const char *what) {
char **payload=s->scheduled;
char *buf;
-
+
buf = malloc(strlen(type)+strlen(what)+strlen(RTSP_PROTOCOL_VERSION)+3);
-
+
sprintf(buf,"%s %s %s",type, what, RTSP_PROTOCOL_VERSION);
rtsp_put(s,buf);
free(buf);
@@ -240,10 +240,10 @@ static void rtsp_send_request(rtsp_t *s, const char *type, const char *what) {
static void rtsp_schedule_standard(rtsp_t *s) {
char tmp[17];
-
+
snprintf(tmp, 17, "CSeq: %u", s->cseq);
rtsp_schedule_field(s, tmp);
-
+
if (s->session) {
char *buf;
buf = malloc(strlen(s->session)+15);
@@ -255,7 +255,7 @@ static void rtsp_schedule_standard(rtsp_t *s) {
/*
* get the answers, if server responses with something != 200, return NULL
*/
-
+
static int rtsp_get_answers(rtsp_t *s) {
char *answer=NULL;
@@ -263,7 +263,7 @@ static int rtsp_get_answers(rtsp_t *s) {
char **answer_ptr=s->answers;
int code;
int ans_count = 0;
-
+
answer=rtsp_get(s);
if (!answer)
return 0;
@@ -271,13 +271,13 @@ static int rtsp_get_answers(rtsp_t *s) {
free(answer);
rtsp_free_answers(s);
-
+
do { /* while we get answer lines */
-
+
answer=rtsp_get(s);
if (!answer)
return 0;
-
+
if (!strncasecmp(answer,"CSeq:",5)) {
sscanf(answer,"%*s %u",&answer_seq);
if (s->cseq != answer_seq) {
@@ -315,12 +315,12 @@ static int rtsp_get_answers(rtsp_t *s) {
*answer_ptr=answer;
answer_ptr++;
} while ((strlen(answer)!=0) && (++ans_count < MAX_FIELDS));
-
+
s->cseq++;
-
+
*answer_ptr=NULL;
rtsp_schedule_standard(s);
-
+
return code;
}
@@ -330,7 +330,7 @@ static int rtsp_get_answers(rtsp_t *s) {
int rtsp_send_ok(rtsp_t *s) {
char cseq[16];
-
+
rtsp_put(s, "RTSP/1.0 200 OK");
sprintf(cseq,"CSeq: %u", s->cseq);
rtsp_put(s, cseq);
@@ -373,7 +373,7 @@ int rtsp_request_describe(rtsp_t *s, const char *what) {
}
rtsp_send_request(s,RTSP_METHOD_DESCRIBE,buf);
free(buf);
-
+
return rtsp_get_answers(s);
}
@@ -388,12 +388,12 @@ int rtsp_request_setup(rtsp_t *s, const char *what, char *control) {
int len = strlen (s->host) + strlen (s->path) + 16;
if (control)
len += strlen (control) + 1;
-
+
buf = malloc (len);
sprintf (buf, "rtsp://%s:%i/%s%s%s", s->host, s->port, s->path,
control ? "/" : "", control ? control : "");
}
-
+
rtsp_send_request (s, RTSP_METHOD_SETUP, buf);
free (buf);
return rtsp_get_answers (s);
@@ -412,7 +412,7 @@ int rtsp_request_setparameter(rtsp_t *s, const char *what) {
}
rtsp_send_request(s,RTSP_METHOD_SET_PARAMETER,buf);
free(buf);
-
+
return rtsp_get_answers(s);
}
@@ -420,7 +420,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
char *buf;
int ret;
-
+
if (what) {
buf=strdup(what);
} else
@@ -430,7 +430,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
}
rtsp_send_request(s,RTSP_METHOD_PLAY,buf);
free(buf);
-
+
ret = rtsp_get_answers (s);
if (ret == RTSP_STATUS_OK)
s->server_state = RTSP_PLAYING;
@@ -441,7 +441,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
int rtsp_request_teardown(rtsp_t *s, const char *what) {
char *buf;
-
+
if (what)
buf = strdup (what);
else
@@ -474,7 +474,7 @@ int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) {
{
char *rest=rtsp_get(s);
if (!rest)
- return -1;
+ return -1;
seq=-1;
do {
@@ -540,10 +540,10 @@ rtsp_t *rtsp_connect(int fd, char* mrl, char *path, char *host, int port, char *
s->server=NULL;
s->server_state=0;
s->server_caps=0;
-
+
s->cseq=0;
s->session=NULL;
-
+
if (user_agent)
s->user_agent=strdup(user_agent);
else
@@ -587,7 +587,7 @@ char *rtsp_search_answers(rtsp_t *s, const char *tag) {
char **answer;
char *ptr;
-
+
if (!s->answers) return NULL;
answer=s->answers;
@@ -652,7 +652,7 @@ char *rtsp_get_param(rtsp_t *s, const char *p) {
}
return NULL;
}
-
+
/*
* schedules a field for transmission
*/
@@ -660,7 +660,7 @@ char *rtsp_get_param(rtsp_t *s, const char *p) {
void rtsp_schedule_field(rtsp_t *s, const char *string) {
int i=0;
-
+
if (!string) return;
while(s->scheduled[i]) {
@@ -670,13 +670,13 @@ void rtsp_schedule_field(rtsp_t *s, const char *string) {
}
/*
- * removes the first scheduled field which prefix matches string.
+ * removes the first scheduled field which prefix matches string.
*/
void rtsp_unschedule_field(rtsp_t *s, const char *string) {
char **ptr=s->scheduled;
-
+
if (!string) return;
while(*ptr) {
@@ -699,7 +699,7 @@ void rtsp_unschedule_field(rtsp_t *s, const char *string) {
void rtsp_unschedule_all(rtsp_t *s) {
char **ptr;
-
+
if (!s->scheduled) return;
ptr=s->scheduled;
@@ -716,7 +716,7 @@ void rtsp_unschedule_all(rtsp_t *s) {
void rtsp_free_answers(rtsp_t *s) {
char **answer;
-
+
if (!s->answers) return;
answer=s->answers;
diff --git a/stream/librtsp/rtsp.h b/stream/librtsp/rtsp.h
index efca1f7779..5252f8de22 100644
--- a/stream/librtsp/rtsp.h
+++ b/stream/librtsp/rtsp.h
@@ -28,7 +28,7 @@
* 2006, Benjamin Zores and Vincent Mussard
* fixed a lot of RFC compliance issues.
*/
-
+
#ifndef MPLAYER_RTSP_H
#define MPLAYER_RTSP_H
@@ -65,7 +65,7 @@ struct rtsp_s {
char *server;
unsigned int server_state;
uint32_t server_caps;
-
+
unsigned int cseq;
char *session;
diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c
index 66c7be4a36..37400e62d1 100644
--- a/stream/librtsp/rtsp_rtp.c
+++ b/stream/librtsp/rtsp_rtp.c
@@ -57,7 +57,7 @@
#define RTSP_NPT_NOW "npt=now-"
#define RTSP_MEDIA_CONTAINER_MPEG_TS "33"
#define RTSP_TRANSPORT_REQUEST "Transport: RTP/AVP;%s;%s%i-%i;mode=\"PLAY\""
-
+
#define RTSP_TRANSPORT_MULTICAST "multicast"
#define RTSP_TRANSPORT_UNICAST "unicast"
@@ -82,7 +82,7 @@ rtcp_send_rr (rtsp_t *s, struct rtp_rtsp_session_t *st)
{
if (st->rtcp_socket == -1)
return;
-
+
/* send RTCP RR every RTCP_SEND_FREQUENCY packets
* FIXME : NOT CORRECT, HARDCODED, BUT MAKES SOME SERVERS HAPPY
* not rfc compliant
@@ -108,14 +108,14 @@ static struct rtp_rtsp_session_t *
rtp_session_new (void)
{
struct rtp_rtsp_session_t *st = NULL;
-
+
st = malloc (sizeof (struct rtp_rtsp_session_t));
-
+
st->rtp_socket = -1;
st->rtcp_socket = -1;
st->control_url = NULL;
st->count = 0;
-
+
return st;
}
@@ -153,7 +153,7 @@ parse_port (const char *line, const char *param,
char *parse1;
char *parse2;
char *parse3;
-
+
char *line_copy = strdup (line);
parse1 = strstr (line_copy, param);
@@ -161,14 +161,14 @@ parse_port (const char *line, const char *param,
if (parse1)
{
parse2 = strstr (parse1, "-");
-
+
if (parse2)
{
parse3 = strstr (parse2, ";");
-
+
if (parse3)
parse3[0] = 0;
-
+
parse2[0] = 0;
}
else
@@ -182,12 +182,12 @@ parse_port (const char *line, const char *param,
free (line_copy);
return 0;
}
-
+
*rtp_port = atoi (parse1 + strlen (param));
*rtcp_port = atoi (parse2 + 1);
free (line_copy);
-
+
return 1;
}
@@ -200,21 +200,21 @@ parse_destination (const char *line)
char *dest = NULL;
char *line_copy = strdup (line);
int len;
-
+
parse1 = strstr (line_copy, RTSP_SETUP_DESTINATION);
if (!parse1)
{
free (line_copy);
return NULL;
}
-
+
parse2 = strstr (parse1, ";");
if (!parse2)
{
free (line_copy);
return NULL;
}
-
+
len = strlen (parse1) - strlen (parse2)
- strlen (RTSP_SETUP_DESTINATION) + 1;
dest = (char *) malloc (len + 1);
@@ -230,7 +230,7 @@ rtcp_connect (int client_port, int server_port, const char* server_hostname)
struct sockaddr_in sin;
struct hostent *hp;
int s;
-
+
if (client_port <= 1023)
return -1;
@@ -249,7 +249,7 @@ rtcp_connect (int client_port, int server_port, const char* server_hostname)
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons (client_port);
-
+
if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
{
#if !HAVE_WINSOCK2_H
@@ -262,7 +262,7 @@ rtcp_connect (int client_port, int server_port, const char* server_hostname)
return -1;
}
}
-
+
sin.sin_family = AF_INET;
memcpy (&(sin.sin_addr.s_addr), hp->h_addr, sizeof (hp->h_addr));
sin.sin_port = htons (server_port);
@@ -328,7 +328,7 @@ rtp_connect (char *hostname, int port)
return -1;
}
}
-
+
/* datagram socket */
if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
{
@@ -346,10 +346,10 @@ rtp_connect (char *hostname, int port)
tv.tv_sec = 1; /* 1 second timeout */
tv.tv_usec = 0;
-
+
FD_ZERO (&set);
FD_SET (s, &set);
-
+
err = select (s + 1, &set, NULL, NULL, &tv);
if (err < 0)
{
@@ -363,7 +363,7 @@ rtp_connect (char *hostname, int port)
close (s);
return -1;
}
-
+
err_len = sizeof (err);
getsockopt (s, SOL_SOCKET, SO_ERROR, &err, (socklen_t *) &err_len);
if (err)
@@ -372,7 +372,7 @@ rtp_connect (char *hostname, int port)
close (s);
return -1;
}
-
+
return s;
}
@@ -383,7 +383,7 @@ is_multicast_address (char *addr)
if (!addr)
return -1;
-
+
sin.sin_family = AF_INET;
#if HAVE_INET_PTON
@@ -393,7 +393,7 @@ is_multicast_address (char *addr)
#elif HAVE_WINSOCK2_H
sin.sin_addr.s_addr = htonl (INADDR_ANY);
#endif
-
+
if ((ntohl (sin.sin_addr.s_addr) >> 28) == 0xe)
return 1;
@@ -416,7 +416,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
int statut;
int content_length = 0;
int is_multicast = 0;
-
+
fsdp_description_t *dsc = NULL;
fsdp_error_t result;
@@ -451,7 +451,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
return NULL;
}
sdp[content_length] = 0;
-
+
/* 3. parse SDP message */
dsc = fsdp_description_new ();
result = fsdp_parse (sdp, dsc);
@@ -490,7 +490,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
}
/* 6. parse the `m=<media> <port> <transport> <fmt list>' line */
-
+
/* check for an A/V media */
if (fsdp_get_media_type (med_dsc) != FSDP_MEDIA_VIDEO &&
fsdp_get_media_type (med_dsc) != FSDP_MEDIA_AUDIO)
@@ -498,7 +498,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
fsdp_description_delete (dsc);
return NULL;
}
-
+
/* only RTP/AVP transport method is supported right now */
if (fsdp_get_media_transport_protocol (med_dsc) != FSDP_TP_RTP_AVP)
{
@@ -535,7 +535,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
/* RTCP port generally is RTP port + 1 */
client_rtcp_port = client_rtp_port + 1;
-
+
mp_msg (MSGT_OPEN, MSGL_V,
"RTP Port from SDP appears to be: %d\n", client_rtp_port);
mp_msg (MSGT_OPEN, MSGL_V,
@@ -573,7 +573,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
/* no control for media: try global one instead */
server_addr = strdup (fsdp_get_global_conn_address (dsc));
}
-
+
if (!server_addr)
{
fsdp_description_delete (dsc);
@@ -611,7 +611,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
is_multicast ? RTSP_MULTICAST_PORT : RTSP_UNICAST_CLIENT_PORT,
client_rtp_port, client_rtcp_port);
mp_msg (MSGT_OPEN, MSGL_V, "RTSP Transport: %s\n", temp_buf);
-
+
rtsp_unschedule_field (rtsp_session, RTSP_SESSION);
rtsp_schedule_field (rtsp_session, temp_buf);
@@ -622,7 +622,7 @@ rtp_setup_and_play (rtsp_t *rtsp_session)
else /* relative URL */
statut = rtsp_request_setup (rtsp_session,
NULL, rtp_session->control_url);
-
+
if (statut < 200 || statut > 299)
{
free (server_addr);
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index c196e5305d..8b87d7fb41 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -77,7 +77,7 @@ struct rtsp_session_s {
};
/*
- * closes an rtsp connection
+ * closes an rtsp connection
*/
static void rtsp_close(rtsp_t *s) {
@@ -96,7 +96,7 @@ static void rtsp_close(rtsp_t *s) {
if (s->user_agent) free(s->user_agent);
rtsp_free_answers(s);
rtsp_unschedule_all(s);
- free(s);
+ free(s);
}
//rtsp_session_t *rtsp_session_start(char *mrl) {
@@ -112,7 +112,7 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host,
rtsp_session->s = NULL;
rtsp_session->real_session = NULL;
rtsp_session->rtp_session = NULL;
-
+
//connect:
*redir = 0;
@@ -164,7 +164,7 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host,
return NULL;
}
}
-
+
rtsp_session->real_session = init_real_rtsp_session ();
if(!strncmp(h->streams[0]->mime_type, "application/vnd.rn-rmadriver", h->streams[0]->mime_type_size) ||
!strncmp(h->streams[0]->mime_type, "application/smil", h->streams[0]->mime_type_size)) {
@@ -239,12 +239,12 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host,
}
}
free(server);
-
+
return rtsp_session;
}
int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
-
+
if (this->real_session) {
int to_copy=len;
char *dest=data;
@@ -257,7 +257,7 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
if (len < 0) return 0;
if (this->real_session->recv_size < 0) return -1;
while (to_copy > fill) {
-
+
memcpy(dest, source, fill);
to_copy -= fill;
dest += fill;
@@ -278,7 +278,7 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
return len-to_copy;
}
}
-
+
memcpy(dest, source, to_copy);
this->real_session->recv_read += to_copy;
@@ -298,7 +298,7 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
if (l == 0)
rtsp_session_end (this);
-
+
return l;
}
diff --git a/stream/network.c b/stream/network.c
index 19a87ea2a9..801bebaf24 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -139,7 +139,7 @@ check4proxies( URL_t *url ) {
MSGTR_MPDEMUX_NW_InvalidProxySettingTryingWithout);
return url_out;
}
-
+
#ifdef HAVE_AF_INET6
if (network_ipv4_only_proxy && (gethostbyname(url->hostname)==NULL)) {
mp_msg(MSGT_NETWORK,MSGL_WARN,
@@ -208,14 +208,14 @@ http_send_request( URL_t *url, off_t pos ) {
if( strcasecmp(url->protocol, "noicyx") )
http_set_field(http_hdr, "Icy-MetaData: 1");
- if(pos>0) {
+ if(pos>0) {
// Extend http_send_request with possibility to do partial content retrieval
snprintf(str, 256, "Range: bytes=%"PRId64"-", (int64_t)pos);
http_set_field(http_hdr, str);
}
-
+
if (network_cookies_enabled) cookies_set( http_hdr, server_url->hostname, server_url->url );
-
+
http_set_field( http_hdr, "Connection: close");
http_add_basic_authentication( http_hdr, url->username, url->password );
if( http_build_request( http_hdr )==NULL ) {
@@ -235,13 +235,13 @@ http_send_request( URL_t *url, off_t pos ) {
goto err_out;
}
mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request: [%s]\n", http_hdr->buffer );
-
+
ret = send( fd, http_hdr->buffer, http_hdr->buffer_size, 0 );
if( ret!=(int)http_hdr->buffer_size ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ErrSendingHTTPRequest);
goto err_out;
}
-
+
http_free( http_hdr );
return fd;
@@ -265,7 +265,7 @@ http_read_response( int fd ) {
}
do {
- i = recv( fd, response, BUFFER_SIZE, 0 );
+ i = recv( fd, response, BUFFER_SIZE, 0 );
if( i<0 ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ReadFailed);
http_free( http_hdr );
@@ -277,7 +277,7 @@ http_read_response( int fd ) {
return NULL;
}
http_response_append( http_hdr, response, i );
- } while( !http_is_header_entire( http_hdr ) );
+ } while( !http_is_header_entire( http_hdr ) );
http_response_parse( http_hdr );
return http_hdr;
}
@@ -340,7 +340,7 @@ http_seek( stream_t *stream, off_t pos ) {
if( stream==NULL ) return 0;
if( stream->fd>0 ) closesocket(stream->fd); // need to reconnect to seek in http-stream
- fd = http_send_request( stream->streaming_ctrl->url, pos );
+ fd = http_send_request( stream->streaming_ctrl->url, pos );
if( fd<0 ) return 0;
http_hdr = http_read_response( fd );
@@ -420,7 +420,7 @@ nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctr
len += ret;
//printf("read %d bytes from network\n", len );
}
-
+
return len;
}
diff --git a/stream/open.c b/stream/open.c
index 0ec0222c32..5ef0a9e3ff 100644
--- a/stream/open.c
+++ b/stream/open.c
@@ -31,7 +31,7 @@ int dvd_title=0;
// Open a new stream (stdin/file/vcd/url)
stream_t* open_stream(char* filename,char** options, int* file_format){
- // Check if playlist or unknown
+ // Check if playlist or unknown
if (*file_format != DEMUXER_TYPE_PLAYLIST){
*file_format=DEMUXER_TYPE_UNKNOWN;
}
diff --git a/stream/pnm.c b/stream/pnm.c
index 437ad8b0cb..650aeb40cb 100644
--- a/stream/pnm.c
+++ b/stream/pnm.c
@@ -19,7 +19,7 @@
*
* $Id$
*
- * pnm protocol implementation
+ * pnm protocol implementation
* based upon code from joschka
*/
@@ -152,26 +152,26 @@ static const unsigned char pnm_header[] = {
0x00, 0x01 };
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',
- 0, 0x46, 'p','n','r','v',
- 0, 0x32, 'd','n','e','t',
- 0, 0x2b, 'p','n','r','v',
- 0, 0x28, 'd','n','e','t',
- 0, 0x24, 'p','n','r','v',
- 0, 0x19, 'd','n','e','t',
- 0, 0x18, 'p','n','r','v',
- 0, 0x14, 's','i','p','r',
- 0, 0x14, 'd','n','e','t',
- 0, 0x24, '2','8','_','8',
- 0, 0x12, 'p','n','r','v',
- 0, 0x0f, 'd','n','e','t',
- 0, 0x0a, 's','i','p','r',
- 0, 0x0a, 'd','n','e','t',
- 0, 0x08, 's','i','p','r',
- 0, 0x06, 's','i','p','r',
- 0, 0x12, 'l','p','c','J',
+ 0x07, 0x8a, 'p','n','r','v',
+ 0, 0x90, 'p','n','r','v',
+ 0, 0x64, 'd','n','e','t',
+ 0, 0x46, 'p','n','r','v',
+ 0, 0x32, 'd','n','e','t',
+ 0, 0x2b, 'p','n','r','v',
+ 0, 0x28, 'd','n','e','t',
+ 0, 0x24, 'p','n','r','v',
+ 0, 0x19, 'd','n','e','t',
+ 0, 0x18, 'p','n','r','v',
+ 0, 0x14, 's','i','p','r',
+ 0, 0x14, 'd','n','e','t',
+ 0, 0x24, '2','8','_','8',
+ 0, 0x12, 'p','n','r','v',
+ 0, 0x0f, 'd','n','e','t',
+ 0, 0x0a, 's','i','p','r',
+ 0, 0x0a, 'd','n','e','t',
+ 0, 0x08, 's','i','p','r',
+ 0, 0x06, 's','i','p','r',
+ 0, 0x12, 'l','p','c','J',
0, 0x07, '0','5','_','6' };
static const uint32_t pnm_default_bandwidth=10485800;
@@ -185,7 +185,7 @@ static const unsigned char pnm_twentyfour[]={
/* now other data follows. marked with 0x0000 at the beginning */
static const unsigned char after_chunks[]={
0x00, 0x00, /* mark */
-
+
0x50, 0x84, /* seems to be fixated */
0x1f, 0x3a /* varies on each request (checksum ?)*/
};
@@ -196,7 +196,7 @@ static int rm_write(int s, const char *buf, int len) {
int total, timeout;
total = 0; timeout = 30;
- while (total < len){
+ while (total < len){
int n;
n = send (s, &buf[total], len - total, 0);
@@ -219,26 +219,26 @@ static int rm_write(int s, const char *buf, int len) {
}
static ssize_t rm_read(int fd, void *buf, size_t count) {
-
+
ssize_t ret, total;
total = 0;
while (total < count) {
-
+
fd_set rset;
struct timeval timeout;
FD_ZERO (&rset);
FD_SET (fd, &rset);
-
+
timeout.tv_sec = 3;
timeout.tv_usec = 0;
-
+
if (select (fd+1, &rset, NULL, NULL, &timeout) <= 0) {
return -1;
}
-
+
ret=recv (fd, ((uint8_t*)buf)+total, count-total, 0);
if (ret<=0) {
@@ -254,7 +254,7 @@ static ssize_t rm_read(int fd, void *buf, size_t count) {
/*
* debugging utilities
*/
-
+
static void hexdump (char *buf, int length) {
int i;
@@ -288,10 +288,10 @@ static void hexdump (char *buf, int length) {
/*
* pnm_get_chunk gets a chunk from stream
- * and returns number of bytes read
+ * and returns number of bytes read
*/
-static int pnm_get_chunk(pnm_t *p,
+static int pnm_get_chunk(pnm_t *p,
unsigned int max,
unsigned int *chunk_type,
char *data, int *need_response) {
@@ -299,7 +299,7 @@ static int pnm_get_chunk(pnm_t *p,
unsigned int chunk_size;
unsigned int n;
char *ptr;
-
+
if (max < PREAMBLE_SIZE)
return -1;
@@ -309,7 +309,7 @@ static int pnm_get_chunk(pnm_t *p,
rm_read (p->s, data, PREAMBLE_SIZE);
else
rm_read (p->s, data+CHECKSUM_SIZE, PREAMBLE_SIZE-CHECKSUM_SIZE);
-
+
max -= PREAMBLE_SIZE;
*chunk_type = AV_RB32(data);
@@ -347,7 +347,7 @@ static int pnm_get_chunk(pnm_t *p,
mp_msg(MSGT_OPEN, MSGL_WARN, "%s\n",ptr+3);
return -1;
}
-
+
if (*ptr == 'F') /* checking for server error */
{
mp_msg(MSGT_OPEN, MSGL_ERR, "input_pnm: server error.\n");
@@ -391,7 +391,7 @@ static int pnm_get_chunk(pnm_t *p,
break;
default:
*chunk_type = 0;
- chunk_size = PREAMBLE_SIZE;
+ chunk_size = PREAMBLE_SIZE;
break;
}
@@ -402,13 +402,13 @@ static int pnm_get_chunk(pnm_t *p,
* writes a chunk to a buffer, returns number of bytes written
*/
-static int pnm_write_chunk(uint16_t chunk_id, uint16_t length,
+static int pnm_write_chunk(uint16_t chunk_id, uint16_t length,
const char *chunk, char *data) {
AV_WB16(&data[0], chunk_id);
AV_WB16(&data[2], length);
memcpy(&data[4],chunk,length);
-
+
return length+4;
}
@@ -446,7 +446,7 @@ static void pnm_send_request(pnm_t *p, uint32_t bandwidth) {
pnm_guid,&p->buffer[c]);
c+=pnm_write_chunk(PNA_TWENTYFOUR,sizeof(pnm_twentyfour),
pnm_twentyfour,&p->buffer[c]);
-
+
/* data after chunks */
memcpy(&p->buffer[c],after_chunks,sizeof(after_chunks));
c+=sizeof(after_chunks);
@@ -468,7 +468,7 @@ static void pnm_send_request(pnm_t *p, uint32_t bandwidth) {
/* some trailing bytes */
p->buffer[c]='y';
p->buffer[c+1]='B';
-
+
rm_write(p->s,p->buffer,c+2);
}
@@ -533,12 +533,12 @@ static int pnm_get_headers(pnm_t *p, int *need_response) {
size+=chunk_size;
ptr+=chunk_size;
}
-
+
if (!prop_hdr) {
mp_msg(MSGT_OPEN, MSGL_ERR, "input_pnm: error while parsing headers.\n");
return 0;
}
-
+
/* set data offset */
AV_WB32(&prop_hdr[42], size - 1);
@@ -549,18 +549,18 @@ static int pnm_get_headers(pnm_t *p, int *need_response) {
/* now write a data header */
memcpy(ptr, pnm_data_header, sizeof(pnm_data_header));
size+=sizeof(pnm_data_header);
-/*
+/*
h=rmff_scan_header(p->header);
rmff_fix_header(h);
p->header_len=rmff_get_header_size(h);
rmff_dump_header(h, p->header, HEADER_SIZE);
*/
p->header_len=size;
-
+
return 1;
}
-/*
+/*
* determine correct stream number by looking at indices
*/
@@ -638,7 +638,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
/* send a keepalive */
/* realplayer seems to do that every 43th package */
- if (p->packet%43 == 42)
+ if (p->packet%43 == 42)
rm_write(p->s,&keepalive,1);
/* data chunks begin with: 'Z' <o> <o> <i1> 'Z' <i2>
@@ -646,11 +646,11 @@ static int pnm_get_stream_chunk(pnm_t *p) {
* <i1> is a 16 bit index
* <i2> is a 8 bit index which counts from 0x10 to somewhere
*/
-
+
n = rm_read (p->s, p->buffer, 8);
if (n<0) return -1;
if (n<8) return 0;
-
+
/* skip 8 bytes if 0x62 is read */
if (p->buffer[0] == 0x62)
{
@@ -660,7 +660,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
mp_msg(MSGT_OPEN, MSGL_WARN, "input_pnm: had to seek 8 bytes on 0x62\n");
#endif
}
-
+
/* a server message */
if (p->buffer[0] == 'X')
{
@@ -713,7 +713,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
/* get first index */
p->seq_current[0]=AV_RB16(&p->buffer[5]);
-
+
/* now read the rest of stream chunk */
n = rm_read (p->s, &p->recv[5], fof1-5);
if (n<fof1-5) return 0;
@@ -723,15 +723,15 @@ static int pnm_get_stream_chunk(pnm_t *p) {
/* get timestamp */
p->ts_current=AV_RB32(&p->recv[6]);
-
+
/* get stream number */
stream=pnm_calc_stream(p);
/* saving timestamp */
p->ts_last[stream]=p->ts_current;
-
+
/* constructing a data packet header */
-
+
p->recv[0]=0; /* object version */
p->recv[1]=0;
@@ -739,7 +739,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
p->recv[4]=0; /* stream number */
p->recv[5]=stream;
-
+
p->recv[10] &= 0xfe; /* streambox seems to do that... */
p->packet++;
@@ -751,10 +751,10 @@ static int pnm_get_stream_chunk(pnm_t *p) {
// pnm_t *pnm_connect(const char *mrl) {
static pnm_t *pnm_connect(int fd, char *path) {
-
+
pnm_t *p=malloc(sizeof(pnm_t));
int need_response=0;
-
+
p->path=strdup(path);
p->s=fd;
@@ -769,7 +769,7 @@ static pnm_t *pnm_connect(int fd, char *path) {
pnm_send_response(p, pnm_response);
p->ts_last[0]=0;
p->ts_last[1]=0;
-
+
/* copy header to recv */
memcpy(p->recv, p->header, p->header_len);
@@ -780,16 +780,16 @@ static pnm_t *pnm_connect(int fd, char *path) {
}
static int pnm_read (pnm_t *this, char *data, int len) {
-
+
int to_copy=len;
char *dest=data;
char *source=this->recv + this->recv_read;
int fill=this->recv_size - this->recv_read;
int retval;
-
+
if (len < 0) return 0;
while (to_copy > fill) {
-
+
memcpy(dest, source, fill);
to_copy -= fill;
dest += fill;
@@ -839,12 +839,12 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
fd = connect2Server( stream->streaming_ctrl->url->hostname,
stream->streaming_ctrl->url->port ? stream->streaming_ctrl->url->port : 7070,1 );
-
+
if(fd<0)
goto fail;
pnm = pnm_connect(fd,stream->streaming_ctrl->url->file);
- if(!pnm)
+ if(!pnm)
goto fail;
stream->type = STREAMTYPE_STREAM;
stream->fd=fd;
diff --git a/stream/pnm.h b/stream/pnm.h
index 42b4388a53..34f500849b 100644
--- a/stream/pnm.h
+++ b/stream/pnm.h
@@ -21,7 +21,7 @@
*
* pnm util functions header by joschka
*/
-
+
#ifndef MPLAYER_PNM_H
#define MPLAYER_PNM_H
diff --git a/stream/pvr.h b/stream/pvr.h
index e0672a272a..b596c98dd3 100644
--- a/stream/pvr.h
+++ b/stream/pvr.h
@@ -40,7 +40,7 @@ const char *pvr_get_current_stationname (stream_t *stream);
/**
* @brief Get the current channel name.
* The pointer is valid, till the stream is closed.
- * @return The stream's channel name
+ * @return The stream's channel name
*/
const char *pvr_get_current_channelname (stream_t *stream);
diff --git a/stream/realrtsp/asmrp.c b/stream/realrtsp/asmrp.c
index d5dcbae003..d4f7ce8267 100644
--- a/stream/realrtsp/asmrp.c
+++ b/stream/realrtsp/asmrp.c
@@ -6,7 +6,7 @@
* Copyright (C) 2002 the xine project
*
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -83,7 +83,7 @@ typedef struct {
int sym;
int num;
-
+
char str[ASMRP_MAX_ID];
/* private part */
@@ -113,7 +113,7 @@ static void asmrp_dispose (asmrp_t *p) {
int i;
- for (i=0; i<p->sym_tab_num; i++)
+ for (i=0; i<p->sym_tab_num; i++)
free (p->sym_tab[i].id);
free (p);
@@ -133,7 +133,7 @@ static void asmrp_init (asmrp_t *p, const char *str) {
p->buf = strdup (str);
p->pos = 0;
-
+
asmrp_getch (p);
}
@@ -169,10 +169,10 @@ static void asmrp_string (asmrp_t *p) {
asmrp_getch (p);
}
p->str[l]=0;
-
+
if (p->ch=='"')
asmrp_getch (p);
-
+
p->sym = ASMRP_SYM_STRING;
}
@@ -193,7 +193,7 @@ static void asmrp_identifier (asmrp_t *p) {
asmrp_getch (p);
}
p->str[l]=0;
-
+
p->sym = ASMRP_SYM_ID;
}
@@ -397,10 +397,10 @@ static int asmrp_set_id (asmrp_t *p, char *s, int v) {
printf ("new symbol '%s'\n", s);
#endif
- }
+ }
p->sym_tab[i].v = v;
-
+
#ifdef LOG
printf ("symbol '%s' assigned %d\n", s, v);
#endif
@@ -413,7 +413,7 @@ static int asmrp_condition (asmrp_t *p) ;
static int asmrp_operand (asmrp_t *p) {
int i, ret;
-
+
#ifdef LOG
printf ("operand\n");
#endif
@@ -425,7 +425,7 @@ static int asmrp_operand (asmrp_t *p) {
case ASMRP_SYM_DOLLAR:
asmrp_get_sym (p);
-
+
if (p->sym != ASMRP_SYM_ID) {
mp_msg(MSGT_STREAM, MSGL_ERR, "error: identifier expected.\n");
break;
@@ -466,7 +466,7 @@ static int asmrp_operand (asmrp_t *p) {
#ifdef LOG
printf ("operand done, =%d\n", ret);
#endif
-
+
return ret;
}
@@ -520,7 +520,7 @@ static int asmrp_comp_expression (asmrp_t *p) {
}
static int asmrp_condition (asmrp_t *p) {
-
+
int a;
#ifdef LOG
@@ -579,7 +579,7 @@ static void asmrp_assignment (asmrp_t *p) {
}
asmrp_get_sym (p);
- if ( (p->sym != ASMRP_SYM_NUM) && (p->sym != ASMRP_SYM_STRING)
+ if ( (p->sym != ASMRP_SYM_NUM) && (p->sym != ASMRP_SYM_STRING)
&& (p->sym != ASMRP_SYM_ID)) {
mp_msg(MSGT_STREAM, MSGL_ERR, "error: number or string expected\n");
return;
@@ -592,7 +592,7 @@ static void asmrp_assignment (asmrp_t *p) {
}
static int asmrp_rule (asmrp_t *p) {
-
+
int ret;
#ifdef LOG
@@ -600,16 +600,16 @@ static int asmrp_rule (asmrp_t *p) {
#endif
ret = 1;
-
+
if (p->sym == ASMRP_SYM_HASH) {
asmrp_get_sym (p);
ret = asmrp_condition (p);
while (p->sym == ASMRP_SYM_COMMA) {
-
+
asmrp_get_sym (p);
-
+
asmrp_assignment (p);
}
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index 6a7ef4e47b..9f01a5dfb0 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -98,18 +98,18 @@ static void real_calc_response_and_checksum (char *response, char *chksum, char
if (ch_len == 40) /* what a hack... */
ch_len=32;
if ( ch_len > 56 ) ch_len=56;
-
+
/* copy challenge to buf */
memcpy(buf+8, challenge, ch_len);
memset(buf+8+ch_len, 0, 56-ch_len);
}
-
+
/* xor challenge bytewise with xor_table */
for (i=0; i<XOR_TABLE_SIZE; i++)
buf[8+i] ^= xor_table[i];
av_md5_sum(zres, buf, 64);
-
+
/* convert zres to ascii string */
for (i=0; i<16; i++ )
sprintf(response+i*2, "%02x", zres[i]);
@@ -133,7 +133,7 @@ static int select_mlti_data(const char *mlti_chunk, int mlti_size, int selection
int numrules, codec, size;
int i;
-
+
/* MLTI chunk should begin with MLTI */
if ((mlti_chunk[0] != 'M')
@@ -174,13 +174,13 @@ static int select_mlti_data(const char *mlti_chunk, int mlti_size, int selection
}
mlti_chunk+=2;
-
+
/* now seek to selected codec */
for (i=0; i<codec; i++) {
size=AV_RB32(mlti_chunk);
mlti_chunk+=size+4;
}
-
+
size=AV_RB32(mlti_chunk);
#ifdef LOG
@@ -205,14 +205,14 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
int max_packet_size=0;
int avg_packet_size=0;
int duration=0;
-
+
if (!data) return NULL;
desc=sdpplin_parse(data);
if (!desc) return NULL;
-
+
buf = xbuffer_init(2048);
header=calloc(1,sizeof(rmff_header_t));
@@ -252,7 +252,7 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
buf = NULL;
} else
len=select_mlti_data(desc->stream[i]->mlti_data, desc->stream[i]->mlti_data_size, rulematches[0], &buf);
-
+
header->streams[i]=rmff_new_mdpr(
desc->stream[i]->stream_id,
desc->stream[i]->max_bit_rate,
@@ -276,7 +276,7 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
else
avg_packet_size=desc->stream[i]->avg_packet_size;
}
-
+
if (*stream_rules && strlen(*stream_rules) && (*stream_rules)[strlen(*stream_rules)-1] == ',')
(*stream_rules)[strlen(*stream_rules)-1]=0; /* delete last ',' in stream_rules */
@@ -360,13 +360,13 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer, int rdt_rawdata) {
n=rtsp_read_data(rtsp_session, header, 6);
if (n<6) return 0;
ts=AV_RB32(header);
-
+
#ifdef LOG
- printf("ts: %u, size: %u, flags: 0x%02x, unknown values: 0x%06x 0x%02x 0x%02x\n",
+ printf("ts: %u, size: %u, flags: 0x%02x, unknown values: 0x%06x 0x%02x 0x%02x\n",
ts, size, flags1, unknown1, header[4], header[5]);
#endif
size+=2;
-
+
ph.object_version=0;
ph.length=size;
ph.stream_number=(flags1>>1)&0x1f;
@@ -388,7 +388,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer, int rdt_rawdata) {
rmff_dump_pheader(&ph, *buffer);
size-=12;
n=rtsp_read_data(rtsp_session, (*buffer)+12, size);
-
+
return (n <= 0) ? 0 : n+12;
}
@@ -435,7 +435,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidt
uint32_t maxbandwidth = bandwidth;
char* authfield = NULL;
int i;
-
+
/* get challenge */
challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
#ifdef LOG
@@ -445,7 +445,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidt
/* set a reasonable default to get the best stream, unless bandwidth given */
if (!bandwidth)
bandwidth = 10485800;
-
+
/* request stream description */
rtsp_send_describe:
rtsp_schedule_field(rtsp_session, "Accept: application/sdp");
@@ -532,7 +532,7 @@ autherr:
mp_msg(MSGT_STREAM, MSGL_WARN, "realrtsp: got no ETag!\n");
else
session_id=strdup(rtsp_search_answers(rtsp_session,"ETag"));
-
+
#ifdef LOG
printf("real: Stream description size: %u\n", size);
#endif
@@ -560,7 +560,7 @@ autherr:
printf("Title: %s\nCopyright: %s\nAuthor: %s\nStreams: %i\n",
h->cont->title, h->cont->copyright, h->cont->author, h->prop->num_streams);
#endif
-
+
/* setup our streams */
real_calc_response_and_checksum (challenge2, checksum, challenge1);
buf = xbuffer_ensure_size(buf, strlen(challenge2) + strlen(checksum) + 32);
@@ -638,7 +638,7 @@ free_real_rtsp_session (struct real_rtsp_session_t* real_session)
{
if (!real_session)
return;
-
+
xbuffer_free (real_session->recv);
free (real_session);
}
diff --git a/stream/realrtsp/real.h b/stream/realrtsp/real.h
index 0569a3db74..40e59c7c23 100644
--- a/stream/realrtsp/real.h
+++ b/stream/realrtsp/real.h
@@ -26,7 +26,7 @@
* adopted from joschkas real tools.
*
*/
-
+
#ifndef MPLAYER_REAL_H
#define MPLAYER_REAL_H
diff --git a/stream/realrtsp/rmff.c b/stream/realrtsp/rmff.c
index 5bfa086bb8..c4430de145 100644
--- a/stream/realrtsp/rmff.c
+++ b/stream/realrtsp/rmff.c
@@ -140,7 +140,7 @@ static int rmff_dump_mdpr(rmff_mdpr_t *mdpr, char *buffer, int bufsize) {
buffer[41+s1] = mdpr->mime_type_size;
s2=mdpr->mime_type_size;
memcpy(&buffer[42+s1], mdpr->mime_type, s2);
-
+
AV_WB32(buffer+42+s1+s2, mdpr->type_specific_len);
s3=mdpr->type_specific_len;
memcpy(&buffer[46+s1+s2], mdpr->type_specific_data, s3);
@@ -161,7 +161,7 @@ static int rmff_dump_cont(rmff_cont_t *cont, char *buffer, int bufsize) {
AV_WB32(buffer, cont->object_id);
AV_WB32(buffer+4, cont->size);
AV_WB16(buffer+8, cont->object_version);
-
+
AV_WB16(buffer+10, cont->title_len);
memcpy(&buffer[12], cont->title, cont->title_len);
p=12+cont->title_len;
@@ -225,7 +225,7 @@ int rmff_dump_header(rmff_header_t *h, char *buffer, int max) {
stream++;
}
}
-
+
if ((size=rmff_dump_dataheader(h->data, &buffer[written], max)) < 0)
goto buftoosmall;
written+=size;
@@ -318,22 +318,22 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data) {
mdpr->start_time=AV_RB32(&data[28]);
mdpr->preroll=AV_RB32(&data[32]);
mdpr->duration=AV_RB32(&data[36]);
-
+
mdpr->stream_name_size=data[40];
mdpr->stream_name=malloc(mdpr->stream_name_size+1);
memcpy(mdpr->stream_name, &data[41], mdpr->stream_name_size);
mdpr->stream_name[mdpr->stream_name_size]=0;
-
+
mdpr->mime_type_size=data[41+mdpr->stream_name_size];
mdpr->mime_type=malloc(mdpr->mime_type_size+1);
memcpy(mdpr->mime_type, &data[42+mdpr->stream_name_size], mdpr->mime_type_size);
mdpr->mime_type[mdpr->mime_type_size]=0;
-
+
mdpr->type_specific_len=AV_RB32(&data[42+mdpr->stream_name_size+mdpr->mime_type_size]);
mdpr->type_specific_data=malloc(mdpr->type_specific_len);
- memcpy(mdpr->type_specific_data,
+ memcpy(mdpr->type_specific_data,
&data[46+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
-
+
return mdpr;
}
@@ -390,7 +390,7 @@ static rmff_data_t *rmff_scan_dataheader(const char *data) {
return dh;
}
-
+
rmff_header_t *rmff_scan_header(const char *data) {
rmff_header_t *header=malloc(sizeof(rmff_header_t));
@@ -414,21 +414,21 @@ rmff_header_t *rmff_scan_header(const char *data) {
}
header->fileheader=rmff_scan_fileheader(ptr);
ptr += header->fileheader->size;
-
+
header->streams=malloc(sizeof(rmff_mdpr_t*)*(header->fileheader->num_headers));
for (i=0; i<header->fileheader->num_headers; i++) {
header->streams[i]=NULL;
}
-
+
for (i=1; i<header->fileheader->num_headers; i++) {
chunk_type = AV_RB32(ptr);
-
+
if (ptr[0] == 0)
{
mp_msg(MSGT_STREAM, MSGL_WARN, "rmff: warning: only %d of %d header found.\n", i, header->fileheader->num_headers);
break;
}
-
+
chunk_size=1;
switch (chunk_type) {
case PROP_TAG:
@@ -552,7 +552,7 @@ rmff_prop_t *rmff_new_prop (
prop->data_offset=data_offset;
prop->num_streams=num_streams;
prop->flags=flags;
-
+
return prop;
}
@@ -571,7 +571,7 @@ rmff_mdpr_t *rmff_new_mdpr(
const char *type_specific_data ) {
rmff_mdpr_t *mdpr=malloc(sizeof(rmff_mdpr_t));
-
+
mdpr->object_id=MDPR_TAG;
mdpr->object_version=0;
@@ -597,7 +597,7 @@ rmff_mdpr_t *rmff_new_mdpr(
mdpr->type_specific_data=malloc(type_specific_len);
memcpy(mdpr->type_specific_data,type_specific_data,type_specific_len);
mdpr->mlti_data=NULL;
-
+
mdpr->size=mdpr->stream_name_size+mdpr->mime_type_size+mdpr->type_specific_len+46;
return mdpr;
@@ -614,7 +614,7 @@ rmff_cont_t *rmff_new_cont(const char *title, const char *author, const char *co
cont->author=NULL;
cont->copyright=NULL;
cont->comment=NULL;
-
+
cont->title_len=0;
cont->author_len=0;
cont->copyright_len=0;
@@ -653,11 +653,11 @@ rmff_data_t *rmff_new_dataheader(uint32_t num_packets, uint32_t next_data_header
return data;
}
-
+
void rmff_print_header(rmff_header_t *h) {
rmff_mdpr_t **stream;
-
+
if(!h) {
printf("rmff_print_header: NULL given\n");
return;
@@ -716,7 +716,7 @@ void rmff_print_header(rmff_header_t *h) {
printf("size : %i\n", h->data->size);
printf("packets : %i\n", h->data->num_packets);
printf("next DATA : 0x%08x\n", h->data->next_data_header);
- }
+ }
}
void rmff_fix_header(rmff_header_t *h) {
@@ -744,7 +744,7 @@ void rmff_fix_header(rmff_header_t *h) {
streams++;
}
}
-
+
if (h->prop) {
if (h->prop->size != 50)
{
@@ -784,7 +784,7 @@ void rmff_fix_header(rmff_header_t *h) {
}
num_headers++;
-
+
if (!h->fileheader) {
#ifdef LOG
printf("rmff_fix_header: no fileheader, creating one");
@@ -801,7 +801,7 @@ void rmff_fix_header(rmff_header_t *h) {
if(h->fileheader->num_headers != num_headers) {
#ifdef LOG
- printf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers);
+ printf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers);
#endif
h->fileheader->num_headers=num_headers;
}
@@ -809,26 +809,26 @@ void rmff_fix_header(rmff_header_t *h) {
if(h->prop) {
if (h->prop->data_offset != header_size) {
#ifdef LOG
- printf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size);
+ printf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size);
#endif
h->prop->data_offset=header_size;
}
if (h->prop->num_packets == 0) {
int p=(int)(h->prop->avg_bit_rate/8.0*(h->prop->duration/1000.0)/h->prop->avg_packet_size);
#ifdef LOG
- printf("rmff_fix_header: assuming prop.num_packets=%i\n", p);
+ printf("rmff_fix_header: assuming prop.num_packets=%i\n", p);
#endif
h->prop->num_packets=p;
}
if (h->data->num_packets == 0) {
#ifdef LOG
- printf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets);
+ printf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets);
#endif
h->data->num_packets=h->prop->num_packets;
}
-
+
#ifdef LOG
- printf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size);
+ printf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size);
#endif
h->data->size=h->prop->num_packets*h->prop->avg_packet_size;
}
@@ -840,7 +840,7 @@ int rmff_get_header_size(rmff_header_t *h) {
if (!h->prop) return -1;
return h->prop->data_offset+18;
-
+
}
void rmff_free_header(rmff_header_t *h) {
diff --git a/stream/realrtsp/rmff.h b/stream/realrtsp/rmff.h
index 3699723f9b..00b6b58ce9 100644
--- a/stream/realrtsp/rmff.h
+++ b/stream/realrtsp/rmff.h
@@ -107,7 +107,7 @@ typedef struct {
uint32_t data_offset;
uint16_t num_streams;
uint16_t flags;
-
+
} rmff_prop_t;
typedef struct {
@@ -150,11 +150,11 @@ typedef struct {
char *copyright;
uint16_t comment_len;
char *comment;
-
+
} rmff_cont_t;
typedef struct {
-
+
uint32_t object_id;
uint32_t size;
uint16_t object_version;
@@ -187,7 +187,7 @@ typedef struct {
/*
* constructors for header structs
*/
-
+
rmff_fileheader_t *rmff_new_fileheader(uint32_t num_headers);
rmff_prop_t *rmff_new_prop (
@@ -256,7 +256,7 @@ void rmff_fix_header(rmff_header_t *h);
* returns the size of the header (incl. first data-header)
*/
int rmff_get_header_size(rmff_header_t *h);
-
+
/*
* dumps the header <h> to <buffer>. <max> is the size of <buffer>
*/
diff --git a/stream/realrtsp/sdpplin.c b/stream/realrtsp/sdpplin.c
index 80dc49edaa..c4104fb00c 100644
--- a/stream/realrtsp/sdpplin.c
+++ b/stream/realrtsp/sdpplin.c
@@ -25,7 +25,7 @@
* sdp/sdpplin parser.
*
*/
-
+
#include "config.h"
#include "stream/librtsp/rtsp.h"
#include "sdpplin.h"
@@ -62,7 +62,7 @@ static char *b64_decode(const char *in, char *out, int *size)
dtable['='] = 0;
k=0;
-
+
/*CONSTANTCONDITION*/
for (j=0; j<strlen(in); j+=4)
{
@@ -121,7 +121,7 @@ static int filter(const char *in, const char *filter, char **out) {
return len-flen;
}
-
+
return 0;
}
static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
@@ -131,7 +131,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
char *decoded=xbuffer_init(32);
int handled;
int got_mimetype;
-
+
if (filter(*data, "m=", &buf)) {
desc->id = strdup(buf);
} else
@@ -156,7 +156,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
#endif
handled=0;
-
+
if(filter(*data,"a=control:streamid=",&buf)) {
desc->stream_id=atoi(buf);
handled=1;
@@ -178,7 +178,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
handled=1;
*data=nl(*data);
}
-
+
if(filter(*data,"a=StartTime:integer;",&buf)) {
desc->start_time=atoi(buf);
handled=1;
@@ -222,7 +222,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
printf("mlti_data_size: %i\n", desc->mlti_data_size);
#endif
}
-
+
if(filter(*data,"a=ASMRuleBook:string;",&buf)) {
desc->asm_rule_book=strdup(buf);
handled=1;
@@ -250,7 +250,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
xbuffer_free(buf);
xbuffer_free(decoded);
-
+
return desc;
}
@@ -273,7 +273,7 @@ sdpplin_t *sdpplin_parse(char *data) {
#endif
handled=0;
-
+
if (filter(data, "m=", &buf)) {
sdpplin_stream_t *stream=sdpplin_parse_stream(&data);
#ifdef LOG
@@ -306,28 +306,28 @@ sdpplin_t *sdpplin_parse(char *data) {
handled=1;
data=nl(data);
}
-
+
if(filter(data,"a=Author:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
desc->author=strdup(decoded);
handled=1;
data=nl(data);
}
-
+
if(filter(data,"a=Copyright:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
desc->copyright=strdup(decoded);
handled=1;
data=nl(data);
}
-
+
if(filter(data,"a=Abstract:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
desc->abstract=strdup(decoded);
handled=1;
data=nl(data);
}
-
+
if(filter(data,"a=StreamCount:integer;",&buf)) {
desc->stream_count=(unsigned int)atoi(buf);
desc->stream=calloc(desc->stream_count, sizeof(sdpplin_stream_t*));
@@ -355,7 +355,7 @@ sdpplin_t *sdpplin_parse(char *data) {
xbuffer_free(buf);
xbuffer_free(decoded);
-
+
return desc;
}
diff --git a/stream/realrtsp/sdpplin.h b/stream/realrtsp/sdpplin.h
index 658aeaf0ed..770a6cb8e1 100644
--- a/stream/realrtsp/sdpplin.h
+++ b/stream/realrtsp/sdpplin.h
@@ -98,7 +98,7 @@ typedef struct {
int duration;
sdpplin_stream_t **stream;
-
+
} sdpplin_t;
sdpplin_t *sdpplin_parse(char *data);
diff --git a/stream/realrtsp/xbuffer.c b/stream/realrtsp/xbuffer.c
index de68125ef1..6b408d68bb 100644
--- a/stream/realrtsp/xbuffer.c
+++ b/stream/realrtsp/xbuffer.c
@@ -1,4 +1,4 @@
-/*
+/*
* xbuffer code
*
* Includes a minimalistic replacement for xine_buffer functions used in
@@ -28,7 +28,7 @@ typedef struct {
-void *xbuffer_init(int chunk_size) {
+void *xbuffer_init(int chunk_size) {
uint8_t *data=calloc(1,chunk_size+XBUFFER_HEADER_SIZE);
xbuffer_header_t *header=(xbuffer_header_t*)data;
@@ -75,7 +75,7 @@ void *xbuffer_ensure_size(void *buf, int size) {
}
xbuf = ((xbuffer_header_t*)(((uint8_t*)buf)-XBUFFER_HEADER_SIZE));
-
+
if (xbuf->size < size) {
new_size = size + xbuf->chunk_size - (size % xbuf->chunk_size);
xbuf->size = new_size;
diff --git a/stream/realrtsp/xbuffer.h b/stream/realrtsp/xbuffer.h
index f311290d7e..695aa2e23f 100644
--- a/stream/realrtsp/xbuffer.h
+++ b/stream/realrtsp/xbuffer.h
@@ -1,4 +1,4 @@
-/*
+/*
* xbuffer code
*
* Includes a minimalistic replacement for xine_buffer functions used in
diff --git a/stream/rtp.c b/stream/rtp.c
index cdfdc28f7b..eebbf665e0 100644
--- a/stream/rtp.c
+++ b/stream/rtp.c
@@ -77,10 +77,10 @@ static int getrtp2(int fd, struct rtpheader *rh, char** data, int* lengthData);
static void rtp_cache_reset(unsigned short seq)
{
int i;
-
+
rtpbuf.first = 0;
rtpbuf.seq[0] = ++seq;
-
+
for (i=0; i<MAXRTPPACKETSIN; i++) {
rtpbuf.len[i] = 0;
}
@@ -94,35 +94,35 @@ static int rtp_cache(int fd, char *buffer, int length)
char *data;
unsigned short seq;
static int is_first = 1;
-
+
getrtp2(fd, &rh, &data, &length);
if(!length)
return 0;
seq = rh.b.sequence;
-
+
newseq = seq - rtpbuf.seq[rtpbuf.first];
-
+
if ((newseq == 0) || is_first)
{
is_first = 0;
-
+
//mp_msg(MSGT_NETWORK, MSGL_DBG4, "RTP (seq[%d]=%d seq=%d, newseq=%d)\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first], seq, newseq);
rtpbuf.first = ( 1 + rtpbuf.first ) % MAXRTPPACKETSIN;
rtpbuf.seq[rtpbuf.first] = ++seq;
goto feed;
}
-
+
if (newseq > MAXRTPPACKETSIN)
{
mp_msg(MSGT_NETWORK, MSGL_DBG2, "Overrun(seq[%d]=%d seq=%d, newseq=%d)\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first], seq, newseq);
rtp_cache_reset(seq);
goto feed;
}
-
+
if (newseq < 0)
{
int i;
-
+
// Is it a stray packet re-sent to network?
for (i=0; i<MAXRTPPACKETSIN; i++) {
if (rtpbuf.seq[i] == seq) {
@@ -135,19 +135,19 @@ static int rtp_cache(int fd, char *buffer, int length)
mp_msg(MSGT_NETWORK, MSGL_ERR, "Too Old packet (seq[%d]=%d seq=%d, newseq=%d)\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first], seq, newseq);
return 0; // Yes, it is!
}
-
+
mp_msg(MSGT_NETWORK, MSGL_ERR, "Underrun(seq[%d]=%d seq=%d, newseq=%d)\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first], seq, newseq);
-
+
rtp_cache_reset(seq);
goto feed;
}
-
+
mp_msg(MSGT_NETWORK, MSGL_DBG4, "Out of Seq (seq[%d]=%d seq=%d, newseq=%d)\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first], seq, newseq);
newseq = ( newseq + rtpbuf.first ) % MAXRTPPACKETSIN;
memcpy (rtpbuf.data[newseq], data, length);
rtpbuf.len[newseq] = length;
rtpbuf.seq[newseq] = seq;
-
+
return 0;
feed:
@@ -165,18 +165,18 @@ static int rtp_get_next(int fd, char *buffer, int length)
// If we have empty buffer we loop to fill it
for (i=0; i < MAXRTPPACKETSIN -3; i++) {
if (rtpbuf.len[rtpbuf.first] != 0) break;
-
+
length = rtp_cache(fd, buffer, length) ;
-
- // returns on first packet in sequence
+
+ // returns on first packet in sequence
if (length > 0) {
//mp_msg(MSGT_NETWORK, MSGL_DBG4, "Getting rtp [%d] %hu\n", i, rtpbuf.first);
return length;
} else if (length < 0) break;
-
+
// Only if length == 0 loop continues!
}
-
+
i = rtpbuf.first;
while (rtpbuf.len[i] == 0) {
mp_msg(MSGT_NETWORK, MSGL_ERR, "Lost packet %hu\n", rtpbuf.seq[i]);
@@ -184,35 +184,35 @@ static int rtp_get_next(int fd, char *buffer, int length)
if (rtpbuf.first == i) break;
}
rtpbuf.first = i;
-
+
// Copy next non empty packet from cache
mp_msg(MSGT_NETWORK, MSGL_DBG4, "Getting rtp from cache [%d] %hu\n", rtpbuf.first, rtpbuf.seq[rtpbuf.first]);
memcpy (buffer, rtpbuf.data[rtpbuf.first], rtpbuf.len[rtpbuf.first]);
length = rtpbuf.len[rtpbuf.first]; // can be zero?
-
+
// Reset fisrt slot and go next in cache
rtpbuf.len[rtpbuf.first] = 0;
nextseq = rtpbuf.seq[rtpbuf.first];
rtpbuf.first = ( 1 + rtpbuf.first ) % MAXRTPPACKETSIN;
rtpbuf.seq[rtpbuf.first] = nextseq + 1;
-
+
return length;
}
-// Read next rtp packet using cache
+// Read next rtp packet using cache
int read_rtp_from_server(int fd, char *buffer, int length) {
// Following test is ASSERT (i.e. uneuseful if code is correct)
if(buffer==NULL || length<STREAM_BUFFER_SIZE) {
mp_msg(MSGT_NETWORK, MSGL_ERR, "RTP buffer invalid; no data return from network\n");
return 0;
}
-
+
// loop just to skip empty packets
while ((length = rtp_get_next(fd, buffer, length)) == 0) {
mp_msg(MSGT_NETWORK, MSGL_ERR, "Got empty packet from RTP cache!?\n");
}
-
+
return length;
}
diff --git a/stream/stream.c b/stream/stream.c
index 85b0a1f907..c145d1389e 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -130,13 +130,13 @@ stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode,
if(desc) {
arg = m_struct_alloc(desc);
if(sinfo->opts_url) {
- m_option_t url_opt =
+ m_option_t url_opt =
{ "stream url", arg , CONF_TYPE_CUSTOM_URL, 0, 0 ,0, sinfo->opts };
if(m_option_parse(&url_opt,"stream url",filename,arg,M_CONFIG_FILE) < 0) {
mp_msg(MSGT_OPEN,MSGL_ERR, "URL parsing failed on url %s\n",filename);
m_struct_free(desc,arg);
return NULL;
- }
+ }
}
if(options) {
int i;
@@ -174,14 +174,14 @@ stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode,
s->flags &= ~STREAM_SEEK;
if(s->seek && !(s->flags & STREAM_SEEK))
s->flags |= STREAM_SEEK;
-
+
s->mode = mode;
mp_msg(MSGT_OPEN,MSGL_V, "STREAM: [%s] %s\n",sinfo->name,filename);
mp_msg(MSGT_OPEN,MSGL_V, "STREAM: Description: %s\n",sinfo->info);
mp_msg(MSGT_OPEN,MSGL_V, "STREAM: Author: %s\n", sinfo->author);
mp_msg(MSGT_OPEN,MSGL_V, "STREAM: Comment: %s\n", sinfo->comment);
-
+
return s;
}
@@ -257,9 +257,9 @@ int stream_fill_buffer(stream_t *s){
case STREAMTYPE_DS:
len = demux_read_data((demux_stream_t*)s->priv,s->buffer,STREAM_BUFFER_SIZE);
break;
-
-
- default:
+
+
+ default:
len= s->fill_buffer ? s->fill_buffer(s,s->buffer,STREAM_BUFFER_SIZE) : 0;
}
if(len<=0){ s->eof=1; s->buf_pos=s->buf_len=0; return 0; }
@@ -320,13 +320,13 @@ if(newpos==0 || newpos!=s->pos){
}
break;
}
-
+
if( s->streaming_ctrl!=NULL && s->streaming_ctrl->streaming_seek ) {
if( s->streaming_ctrl->streaming_seek( s->fd, pos, s->streaming_ctrl )<0 ) {
mp_msg(MSGT_STREAM,MSGL_INFO,"Stream not seekable!\n");
return 1;
}
- }
+ }
#else
if(newpos<s->pos){
mp_msg(MSGT_STREAM,MSGL_INFO,"Cannot seek backward in linear streams!\n");
@@ -359,9 +359,9 @@ while(stream_fill_buffer(s) > 0 && pos >= 0) {
}
pos -= s->buf_len;
}
-
+
// if(pos==s->buf_len) printf("XXX Seek to last byte of file -> EOF\n");
-
+
mp_msg(MSGT_STREAM,MSGL_V,"stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n",(int64_t)(pos+newpos));
return 0;
}
@@ -415,7 +415,7 @@ stream_t* new_stream(int fd,int type){
mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 init: %i\n", temp);
}
#endif
-
+
s->fd=fd;
s->type=type;
s->buf_pos=s->buf_len=0;
diff --git a/stream/stream.h b/stream/stream.h
index 484c6a2232..2bbe443757 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -229,7 +229,7 @@ inline static unsigned char* stream_read_line(stream_t *s,unsigned char* mem, in
len = s->buf_len-s->buf_pos;
// try to fill the buffer
if(len <= 0 &&
- (!cache_stream_fill_buffer(s) ||
+ (!cache_stream_fill_buffer(s) ||
(len = s->buf_len-s->buf_pos) <= 0)) break;
end = (unsigned char*) memchr((void*)(s->buffer+s->buf_pos),'\n',len);
if(end) len = end - (s->buffer+s->buf_pos) + 1;
@@ -267,7 +267,7 @@ inline static int stream_seek(stream_t *s,off_t pos){
return 1;
}
}
-
+
return cache_stream_seek_long(s,pos);
}
@@ -312,7 +312,7 @@ extern char * audio_stream;
typedef struct {
int id; // 0 - 31 mpeg; 128 - 159 ac3; 160 - 191 pcm
- int language;
+ int language;
int type;
int channels;
} stream_language_t;
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index a7555dc7b4..2403e85cd4 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -182,7 +182,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
}
}
#endif
-
+
#ifndef CONFIG_LIBCDIO
if(p->generic_dev)
cdd = cdda_identify_scsi(p->generic_dev,p->device,0,NULL);
@@ -280,7 +280,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
mode = PARANOIA_MODE_OVERLAP;
else
mode = PARANOIA_MODE_FULL;
-
+
if(p->no_skip)
mode |= PARANOIA_MODE_NEVERSKIP;
#ifndef CONFIG_LIBCDIO
@@ -336,7 +336,7 @@ static int fill_buffer(stream_t* s, char* buffer, int max_len) {
cd_track_t *cd_track;
int16_t * buf;
int i;
-
+
if((p->sector < p->start_sector) || (p->sector > p->end_sector)) {
s->eof = 1;
return 0;
@@ -346,7 +346,7 @@ static int fill_buffer(stream_t* s, char* buffer, int max_len) {
if (!buf)
return 0;
-#ifdef WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
for(i=0;i<CD_FRAMESIZE_RAW/2;i++)
buf[i]=le2me_16(buf[i]);
#endif
@@ -359,14 +359,14 @@ static int fill_buffer(stream_t* s, char* buffer, int max_len) {
cd_track = cd_info_get_track(p->cd_info, i+1);
//printf("Track %d, sector=%d\n", i, p->sector-1);
if( cd_track!=NULL ) {
- mp_msg(MSGT_SEEK, MSGL_INFO, "\n%s\n", cd_track->name);
+ mp_msg(MSGT_SEEK, MSGL_INFO, "\n%s\n", cd_track->name);
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDA_TRACK=%d\n", cd_track->track_nb);
}
break;
}
}
-
+
return CD_FRAMESIZE_RAW;
}
@@ -377,7 +377,7 @@ static int seek(stream_t* s,off_t newpos) {
int current_track=0, seeked_track=0;
int seek_to_track = 0;
int i;
-
+
s->pos = newpos;
sec = s->pos/CD_FRAMESIZE_RAW;
if (s->pos < 0 || sec > p->end_sector) {
@@ -387,7 +387,7 @@ static int seek(stream_t* s,off_t newpos) {
//printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);
//printf("sector: %d new: %d\n", p->sector, sec );
-
+
for(i=0;i<p->cd->tracks;i++){
// printf("trk #%d: %d .. %d\n",i,p->cd->disc_toc[i].dwStartSector,p->cd->disc_toc[i+1].dwStartSector);
if( p->sector>=p->cd->disc_toc[i].dwStartSector && p->sector<p->cd->disc_toc[i+1].dwStartSector ) {
diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
index 55620a8b2d..3a51cbc2ec 100644
--- a/stream/stream_cddb.c
+++ b/stream/stream_cddb.c
@@ -1,11 +1,11 @@
/*
- * CDDB HTTP protocol
+ * CDDB HTTP protocol
* by Bertrand Baudet <bertrand_baudet@yahoo.com>
* (C) 2002, MPlayer team.
*
* Implementation follow the freedb.howto1.06.txt specification
* from http://freedb.freedb.org
- *
+ *
* discid computation by Jeremy D. Zawodny
* Copyright (c) 1998-2000 Jeremy D. Zawodny <Jeremy@Zawodny.com>
* Code release under GPL
@@ -68,7 +68,7 @@ stream_t* open_cdda(char *dev, char *track);
static cd_toc_t cdtoc[100];
static int cdtoc_last_track;
-int
+int
read_toc(const char *dev) {
int first = 0, last = -1;
int i;
@@ -100,7 +100,7 @@ read_toc(const char *dev) {
if( drive<0 ) {
return drive;
}
-
+
#if defined(__linux__) || defined(__bsdi__)
{
struct cdrom_tochdr tochdr;
@@ -203,7 +203,7 @@ read_toc(const char *dev) {
return last;
}
-/**
+/**
\brief Reads TOC from CD in the given device and prints the number of tracks
and the length of each track in minute:second:frame format.
\param *dev the device to analyse
@@ -236,7 +236,7 @@ int cdd_identify(const char *dev)
return cdtoc_last_track;
}
-unsigned int
+unsigned int
cddb_sum(int n) {
unsigned int ret;
@@ -248,7 +248,7 @@ cddb_sum(int n) {
return ret;
}
-unsigned long
+unsigned long
cddb_discid(int tot_trks) {
unsigned int i, t = 0, n = 0;
@@ -270,9 +270,9 @@ cddb_http_request(char *command, int (*reply_parser)(HTTP_header_t*,cddb_data_t*
int fd, ret = 0;
URL_t *url;
HTTP_header_t *http_hdr;
-
+
if( reply_parser==NULL || command==NULL || cddb_data==NULL ) return -1;
-
+
sprintf( request, "http://%s/~cddb/cddb.cgi?cmd=%s%s&proto=%d", cddb_data->freedb_server, command, cddb_data->cddb_hello, cddb_data->freedb_proto_level );
mp_msg(MSGT_OPEN, MSGL_INFO,"Request[%s]\n", request );
@@ -281,7 +281,7 @@ cddb_http_request(char *command, int (*reply_parser)(HTTP_header_t*,cddb_data_t*
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NotAValidURL);
return -1;
}
-
+
fd = http_send_request(url,0);
if( fd<0 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToSendHTTPRequest);
@@ -310,7 +310,7 @@ cddb_http_request(char *command, int (*reply_parser)(HTTP_header_t*,cddb_data_t*
http_free( http_hdr );
url_free( url );
-
+
return ret;
}
@@ -322,9 +322,9 @@ cddb_read_cache(cddb_data_t *cddb_data) {
size_t file_size;
if( cddb_data==NULL || cddb_data->cache_dir==NULL ) return -1;
-
+
sprintf( file_name, "%s%08lx", cddb_data->cache_dir, cddb_data->disc_id);
-
+
file_fd = open(file_name, O_RDONLY
#if defined(__MINGW32__) || defined(__CYGWIN__)
| O_BINARY
@@ -342,7 +342,7 @@ cddb_read_cache(cddb_data_t *cddb_data) {
} else {
file_size = stats.st_size < UINT_MAX ? stats.st_size : UINT_MAX - 1;
}
-
+
cddb_data->xmcd_file = malloc(file_size+1);
if( cddb_data->xmcd_file==NULL ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
@@ -356,9 +356,9 @@ cddb_read_cache(cddb_data_t *cddb_data) {
return -1;
}
cddb_data->xmcd_file[cddb_data->xmcd_file_size] = 0;
-
+
close(file_fd);
-
+
return 0;
}
@@ -387,15 +387,15 @@ cddb_write_cache(cddb_data_t *cddb_data) {
return -1;
}
}
-
+
sprintf( file_name, "%s%08lx", cddb_data->cache_dir, cddb_data->disc_id );
-
+
file_fd = creat(file_name, S_IRUSR|S_IWUSR);
if( file_fd<0 ) {
perror("create");
return -1;
}
-
+
wrote = write(file_fd, cddb_data->xmcd_file, cddb_data->xmcd_file_size);
if( wrote<0 ) {
perror("write");
@@ -407,7 +407,7 @@ cddb_write_cache(cddb_data_t *cddb_data) {
close(file_fd);
return -1;
}
-
+
close(file_fd);
return 0;
@@ -421,7 +421,7 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
int ret, status;
if( http_hdr==NULL || cddb_data==NULL ) return -1;
-
+
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
@@ -472,7 +472,7 @@ int
cddb_request_titles(cddb_data_t *cddb_data) {
char command[1024];
sprintf( command, "cddb+read+%s+%08lx", cddb_data->category, cddb_data->disc_id);
- return cddb_http_request(command, cddb_read_parse, cddb_data);
+ return cddb_http_request(command, cddb_read_parse, cddb_data);
}
int
@@ -480,7 +480,7 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
char album_title[100];
char *ptr = NULL;
int ret;
-
+
ptr = strstr(http_hdr->body, "\n");
if( ptr==NULL ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_UnableToFindEOL);
@@ -517,7 +517,7 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
char album_title[100];
char *ptr = NULL;
int ret, status;
-
+
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
@@ -562,7 +562,7 @@ misc c711930d Santana / Supernatural
rock c711930d Santana / Supernatural
blues c711930d Santana / Supernatural
.]
-*/
+*/
case 211:
// Found inexact matches, list follows
cddb_parse_matches_list(http_hdr, cddb_data);
@@ -571,7 +571,7 @@ blues c711930d Santana / Supernatural
mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_ServerReturnsCommandSyntaxErr);
break;
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
}
return -1;
}
@@ -581,10 +581,10 @@ cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
int max;
int ret, status;
char *ptr;
-
+
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
return -1;
}
@@ -603,7 +603,7 @@ cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
cddb_data->freedb_proto_level = max;
return 0;
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
}
return -1;
}
@@ -646,9 +646,9 @@ void
cddb_create_hello(cddb_data_t *cddb_data) {
char host_name[51];
char *user_name;
-
+
if( cddb_data->anonymous ) { // Default is anonymous
- /* Note from Eduardo Pérez Ureta <eperez@it.uc3m.es> :
+ /* Note from Eduardo Pérez Ureta <eperez@it.uc3m.es> :
* We don't send current user/host name in hello to prevent spam.
* Software that sends this is considered spyware
* that most people don't like.
@@ -664,7 +664,7 @@ cddb_create_hello(cddb_data_t *cddb_data) {
sprintf( cddb_data->cddb_hello, "&hello=%s+%s+%s+%s", user_name, host_name, "MPlayer", VERSION );
}
-int
+int
cddb_retrieve(cddb_data_t *cddb_data) {
char offsets[1024], command[1024];
char *ptr;
@@ -678,7 +678,7 @@ cddb_retrieve(cddb_data_t *cddb_data) {
}
ptr[0]=0;
time_len = (cdtoc[cddb_data->tracks].frame)/75;
-
+
cddb_data->freedb_server = DEFAULT_FREEDB_SERVER;
cddb_data->freedb_proto_level = 1;
cddb_data->xmcd_file = NULL;
@@ -727,7 +727,7 @@ cddb_resolve(const char *dev, char **xmcd_file) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NoCDInDrive);
return -1;
}
-
+
home_dir = getenv("HOME");
#ifdef __MINGW32__
if( home_dir==NULL ) home_dir = getenv("USERPROFILE");
@@ -759,7 +759,7 @@ cddb_resolve(const char *dev, char **xmcd_file) {
*xmcd_file = cddb_data.xmcd_file;
return 0;
}
-
+
return -1;
}
@@ -820,7 +820,7 @@ xmcd_parse_ttitle(cd_info_t *cd_info, char *line) {
ptr = strstr(ptr, "=");
if( ptr==NULL ) return NULL;
ptr++;
-
+
sec = cdtoc[track_nb].frame;
off = cdtoc[track_nb+1].frame-sec+1;
@@ -836,12 +836,12 @@ cddb_parse_xmcd(char *xmcd_file) {
char *ptr, *ptr2;
unsigned int audiolen;
if( xmcd_file==NULL ) return NULL;
-
+
cd_info = cd_info_new();
if( cd_info==NULL ) {
return NULL;
}
-
+
length = strlen(xmcd_file);
ptr = xmcd_file;
while( ptr!=NULL && pos<length ) {
@@ -866,10 +866,10 @@ cddb_parse_xmcd(char *xmcd_file) {
ptr = ptr2+1;
}
- audiolen = cdtoc[cd_info->nb_tracks].frame-cdtoc[0].frame;
+ audiolen = cdtoc[cd_info->nb_tracks].frame-cdtoc[0].frame;
cd_info->min = (unsigned int)(audiolen/(60*75));
cd_info->sec = (unsigned int)((audiolen/75)%60);
cd_info->msec = (unsigned int)(audiolen%75);
-
+
return cd_info;
}
diff --git a/stream/stream_cue.c b/stream/stream_cue.c
index 85628131d0..ea9337afb1 100644
--- a/stream/stream_cue.c
+++ b/stream/stream_cue.c
@@ -323,7 +323,7 @@ static int cue_read_cue (char *in_cue_filename)
if (*t == '\0')
strcpy(t, "/");
}
-
+
av_strlcpy(bincue_path,t,sizeof( bincue_path ));
mp_msg(MSGT_OPEN,MSGL_V,"dirname: %s, cuepath: %s\n", t, bincue_path);
@@ -504,7 +504,7 @@ static int cue_vcd_read(stream_t *stream, char *mem, int size) {
tracks[track].start_sector)
* cue_mode_2_sector_size(tracks[track].mode);
-
+
if(position >= tracks[track+1].start_offset)
return 0;
@@ -560,7 +560,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
if(!track)
track = 1;
-
+
f = cue_read_cue(filename);
if(f < 0) {
m_struct_free(&stream_opts,opts);
@@ -569,7 +569,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
cue_vcd_read_toc();
ret2=cue_vcd_get_track_end(track);
ret=cue_vcd_seek_to_track(track);
- if(ret<0){
+ if(ret<0){
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");
return STREAM_UNSUPPORTED;
}
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index d2c5b4b06e..1e157f162c 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -132,7 +132,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
const char *sat_conf = "%d:%c:%d:%d:%255[^:]:%255[^:]\n";
const char *ter_conf = "%d:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]:%255[^:]\n";
const char *atsc_conf = "%d:%255[^:]:%255[^:]:%255[^:]\n";
-
+
mp_msg(MSGT_DEMUX, MSGL_V, "CONFIG_READ FILE: %s, type: %d\n", filename, type);
if((f=fopen(filename, "r"))==NULL)
{
@@ -233,7 +233,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
fields++;
}
}
-
+
if(apid_str[0])
{
cnt = ptr->pids_cnt;
@@ -271,7 +271,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
for(cnt = 0; cnt < ptr->pids_cnt; cnt++)
mp_msg(MSGT_DEMUX, MSGL_V, " %d ", ptr->pids[cnt]);
mp_msg(MSGT_DEMUX, MSGL_V, "\n");
-
+
if((type == TUNER_TER) || (type == TUNER_CBL))
{
if(! strcmp(inv, "INVERSION_ON"))
@@ -304,7 +304,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
ptr->cr =FEC_NONE;
else ptr->cr =FEC_AUTO;
}
-
+
if((type == TUNER_TER) || (type == TUNER_CBL) || (type == TUNER_ATSC))
{
@@ -318,7 +318,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
ptr->mod = QAM_32;
else if(! strcmp(mod, "QAM_16"))
ptr->mod = QAM_16;
-#ifdef DVB_ATSC
+#ifdef DVB_ATSC
else if(! strcmp(mod, "VSB_8") || ! strcmp(mod, "8VSB"))
ptr->mod = VSB_8;
else if(! strcmp(mod, "VSB_16") || !strcmp(mod, "16VSB"))
@@ -351,7 +351,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
else if(! strcmp(gi, "GUARD_INTERVAL_1_8"))
ptr->gi = GUARD_INTERVAL_1_8;
else ptr->gi = GUARD_INTERVAL_1_4;
-
+
if(! strcmp(tmp_lcr, "FEC_1_2"))
ptr->cr_lp =FEC_1_2;
else if(! strcmp(tmp_lcr, "FEC_2_3"))
@@ -373,8 +373,8 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
else if(! strcmp(tmp_lcr, "FEC_NONE"))
ptr->cr_lp =FEC_NONE;
else ptr->cr_lp =FEC_AUTO;
-
-
+
+
if(! strcmp(tmp_hier, "HIERARCHY_1"))
ptr->hier = HIERARCHY_1;
else if(! strcmp(tmp_hier, "HIERARCHY_2"))
@@ -419,7 +419,7 @@ void dvb_free_config(dvb_config_t *config)
{
int i, j;
- for(i=0; i<config->count; i++)
+ for(i=0; i<config->count; i++)
{
if(config->cards[i].name)
free(config->cards[i].name);
@@ -435,7 +435,7 @@ void dvb_free_config(dvb_config_t *config)
free(config->cards[i].list->channels);
}
free(config->cards[i].list);
- }
+ }
free(config);
}
@@ -448,7 +448,7 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
mp_msg(MSGT_DEMUX, MSGL_DBG3, "dvb_streaming_read(%d)\n", size);
tries = priv->retry + 1;
-
+
fd = stream->fd;
while(pos < size)
{
@@ -471,7 +471,7 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
mp_msg(MSGT_DEMUX, MSGL_DBG3, "ret (%d) bytes\n", pos);
}
}
-
+
if(! pos)
mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_streaming_read, return %d bytes\n", pos);
@@ -496,7 +496,7 @@ int dvb_set_channel(stream_t *stream, int card, int n)
mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_set_channel: INVALID CARD NUMBER: %d vs %d, abort\n", card, conf->count);
return 0;
}
-
+
devno = conf->cards[card].devno;
new_list = conf->cards[card].list;
if((n > new_list->NUM_CHANNELS) || (n < 0))
@@ -505,12 +505,12 @@ int dvb_set_channel(stream_t *stream, int card, int n)
return 0;
}
channel = &(new_list->channels[n]);
-
+
if(priv->is_on) //the fds are already open and we have to stop the demuxers
{
for(i = 0; i < priv->demux_fds_cnt; i++)
dvb_demux_stop(priv->demux_fds[i]);
-
+
priv->retry = 0;
while(dvb_streaming_read(stream, buf, 4096) > 0); //empty both the stream's and driver's buffer
if(priv->card != card)
@@ -523,7 +523,7 @@ int dvb_set_channel(stream_t *stream, int card, int n)
}
}
else //close all demux_fds with pos > pids required for the new channel or open other demux_fds if we have too few
- {
+ {
if(! dvb_fix_demuxes(priv, channel->pids_cnt))
return 0;
}
@@ -562,7 +562,7 @@ int dvb_set_channel(stream_t *stream, int card, int n)
if(! dvb_set_ts_filt(priv->demux_fds[i], channel->pids[i], DMX_PES_OTHER))
return 0;
}
-
+
return 1;
}
@@ -712,7 +712,7 @@ static int dvb_open(stream_t *stream, int mode, void *opts, int *file_format)
return STREAM_ERROR;
}
priv->timeout = p->timeout;
-
+
tuner_type = priv->config->cards[priv->card].type;
if(tuner_type == 0)
@@ -729,7 +729,7 @@ static int dvb_open(stream_t *stream, int mode, void *opts, int *file_format)
p->prog, priv->card+1, priv->tuner_type);
priv->list = priv->config->cards[priv->card].list;
-
+
if((! strcmp(p->prog, "")) && (priv->list != NULL))
progname = priv->list->channels[0].name;
else
@@ -747,7 +747,7 @@ static int dvb_open(stream_t *stream, int mode, void *opts, int *file_format)
stream->fill_buffer = dvb_streaming_read;
stream->close = dvbin_close;
m_struct_free(&stream_opts, opts);
-
+
*file_format = DEMUXER_TYPE_MPEG_TS;
return STREAM_OK;
@@ -761,13 +761,13 @@ dvb_config_t *dvb_get_config(void)
dvb_channels_list *list;
dvb_card_config_t *cards = NULL, *tmp;
dvb_config_t *conf = NULL;
-
-
+
+
conf = malloc(sizeof(dvb_config_t));
if(conf == NULL)
return NULL;
- conf->priv = NULL;
+ conf->priv = NULL;
conf->count = 0;
conf->cards = NULL;
for(i=0; i<MAX_CARDS; i++)
@@ -779,7 +779,7 @@ dvb_config_t *dvb_get_config(void)
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_CONFIG, can't open device %s, skipping\n", filename);
continue;
}
-
+
type = dvb_get_tuner_type(fd);
close(fd);
if(type != TUNER_SAT && type != TUNER_TER && type != TUNER_CBL && type != TUNER_ATSC)
@@ -787,7 +787,7 @@ dvb_config_t *dvb_get_config(void)
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_CONFIG, can't detect tuner type of card %d, skipping\n", i);
continue;
}
-
+
switch(type)
{
case TUNER_TER:
@@ -803,7 +803,7 @@ dvb_config_t *dvb_get_config(void)
conf_file = get_path("channels.conf.atsc");
break;
}
-
+
if((access(conf_file, F_OK | R_OK) != 0))
{
if(conf_file)
@@ -822,7 +822,7 @@ dvb_config_t *dvb_get_config(void)
free(conf_file);
if(list == NULL)
continue;
-
+
size = sizeof(dvb_card_config_t) * (conf->count + 1);
tmp = realloc(conf->cards, size);
@@ -865,7 +865,7 @@ const stream_info_t stream_info_dvb = {
"dvbin",
"Nico",
"based on the code from ??? (probably Arpi)",
- dvb_open,
+ dvb_open,
{ "dvb", NULL },
&stream_opts,
1 // Urls are an option string
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index a170bcc1b1..4047e84080 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -292,7 +292,7 @@ int dvd_sid_from_lang(stream_t *stream, unsigned char* lang) {
return d->subtitles[i].id;
}
}
- lang+=2;
+ lang+=2;
while (lang[0]==',' || lang[0]==' ') ++lang;
}
mp_msg(MSGT_OPEN,MSGL_WARN,MSGTR_DVDnoMatchingSubtitle);
@@ -313,11 +313,11 @@ static int dvd_next_cell(dvd_priv_t *d) {
mp_msg(MSGT_DVD,MSGL_DBG2, "dvd_next_cell: next2=0x%X \n",next_cell);
++next_cell;
- if(next_cell>=d->last_cell)
+ if(next_cell>=d->last_cell)
return -1; // EOF
if(d->cur_pgc->cell_playback[next_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK ) {
next_cell+=dvd_angle;
- if(next_cell>=d->last_cell)
+ if(next_cell>=d->last_cell)
return -1; // EOF
}
mp_msg(MSGT_DVD,MSGL_DBG2, "dvd_next_cell: next3=0x%X \n",next_cell);
@@ -354,12 +354,12 @@ read_next:
int next=dvd_next_cell(d);
if(next>=0) {
d->cur_cell=next;
- // if( d->cur_pgc->cell_playback[d->cur_cell].block_type
+ // if( d->cur_pgc->cell_playback[d->cur_cell].block_type
// == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle;
d->cur_pack = d->cur_pgc->cell_playback[ d->cur_cell ].first_sector;
d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector;
mp_msg(MSGT_DVD,MSGL_V, "DVD next cell: %d pack: 0x%X-0x%X \n",d->cur_cell,d->cur_pack,d->cell_last_pack);
- } else
+ } else
return -1; // EOF
}
@@ -702,10 +702,10 @@ static int dvd_seek_to_time(stream_t *stream, ifo_handle_t *vts_file, double sec
return 1;
}
-static int control(stream_t *stream,int cmd,void* arg)
+static int control(stream_t *stream,int cmd,void* arg)
{
dvd_priv_t *d = stream->priv;
- switch(cmd)
+ switch(cmd)
{
case STREAM_CTRL_GET_TIME_LENGTH:
{
@@ -715,7 +715,7 @@ static int control(stream_t *stream,int cmd,void* arg)
case STREAM_CTRL_GET_NUM_CHAPTERS:
{
if(! d->cur_pgc->nr_of_programs) return STREAM_UNSUPPORTED;
- *((unsigned int *)arg) = d->cur_pgc->nr_of_programs;
+ *((unsigned int *)arg) = d->cur_pgc->nr_of_programs;
return 1;
}
case STREAM_CTRL_SEEK_TO_CHAPTER:
@@ -1051,7 +1051,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
d->angle_seek=0;
d->last_cell=d->cur_pgc->nr_of_cells;
- if(d->cur_pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK )
+ if(d->cur_pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK )
d->cur_cell+=dvd_angle;
d->cur_pack = d->cur_pgc->cell_playback[ d->cur_cell ].first_sector;
d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector;
diff --git a/stream/stream_dvd_common.c b/stream/stream_dvd_common.c
index 55bee132b7..9302b5670b 100644
--- a/stream/stream_dvd_common.c
+++ b/stream/stream_dvd_common.c
@@ -3,7 +3,7 @@
#include <dvdread/ifo_types.h>
#include "stream_dvd_common.h"
-/**
+/**
\brief Converts DVD time structure to milliseconds.
\param *dev the DVD time structure to convert
\return returns the time in milliseconds
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index adb0fcb54c..ea8a28fe5f 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -275,7 +275,7 @@ static int seek(stream_t *s, off_t newpos) {
uint32_t sector = 0;
dvdnav_priv_t *priv = s->priv;
- if(s->end_pos && newpos > s->end_pos)
+ if(s->end_pos && newpos > s->end_pos)
newpos = s->end_pos;
sector = newpos / 2048ULL;
if(dvdnav_sector_search(priv->dvdnav, (uint64_t) sector, SEEK_SET) != DVDNAV_STATUS_OK)
@@ -387,7 +387,7 @@ static int control(stream_t *stream, int cmd, void* arg) {
dvdnav_priv_t* priv=stream->priv;
int tit, part;
- switch(cmd)
+ switch(cmd)
{
case STREAM_CTRL_SEEK_TO_CHAPTER:
{
@@ -542,12 +542,12 @@ static void show_audio_subs_languages(dvdnav_t *nav)
id = i + base[format];
if (lang != 0xFFFF) {
mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDaudioStreamInfo, i,
- dvd_audio_stream_types[format], dvd_audio_stream_channels[channels], tmp, id);
+ dvd_audio_stream_types[format], dvd_audio_stream_channels[channels], tmp, id);
if(lang && tmp[0])
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", id, tmp);
}
}
-
+
for(i=0; i<32; i++)
{
lg = dvdnav_get_spu_logical_stream(nav, i);
@@ -571,8 +571,8 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
char *filename;
dvdnav_priv_t *priv;
- if(p->device) filename = p->device;
- else if(dvd_device) filename= dvd_device;
+ if(p->device) filename = p->device;
+ else if(dvd_device) filename= dvd_device;
else filename = DEFAULT_DVD_DEVICE;
if(!(priv=new_dvdnav_stream(filename))) {
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,filename, strerror(errno));
@@ -694,7 +694,7 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but
static int mp_dvdnav_get_aid_from_format (stream_t *stream, int index, uint8_t lg) {
dvdnav_priv_t * priv = stream->priv;
uint8_t format;
-
+
format = dvdnav_audio_stream_format(priv->dvdnav, lg);
switch(format) {
case DVDNAV_FORMAT_AC3:
@@ -989,7 +989,7 @@ int mp_dvdnav_spu_has_changed (stream_t *stream, int clear) {
if (clear)
priv->state &= ~NAV_FLAG_SPU_CHANGE;
-
+
return 1;
}
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 1abc2e1c9e..e1f77bc2ab 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -32,7 +32,7 @@ static const struct m_struct_st stream_opts = {
sizeof(struct stream_priv_s),
&stream_priv_dflts,
stream_opts_fields
-};
+};
static int fill_buffer(stream_t *s, char* buffer, int max_len){
int r = read(s->fd,buffer,max_len);
@@ -121,7 +121,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
#if defined(__CYGWIN__)|| defined(__MINGW32__)
m |= O_BINARY;
-#endif
+#endif
if(!strcmp(filename,"-")){
if(mode == STREAM_READ) {
diff --git a/stream/stream_ftp.c b/stream/stream_ftp.c
index bb833688aa..9ccd27a46a 100644
--- a/stream/stream_ftp.c
+++ b/stream/stream_ftp.c
@@ -80,7 +80,7 @@ static int fd_can_read(int fd,int timeout) {
FD_SET(fd,&fds);
tv.tv_sec = timeout;
tv.tv_usec = 0;
-
+
return select(fd+1, &fds, NULL, NULL, &tv) > 0;
}
@@ -94,7 +94,7 @@ static int readline(char *buf,int max,struct stream_priv_s *ctl)
int x,retval = 0;
char *end,*bp=buf;
int eof = 0;
-
+
do {
if (ctl->cavail > 0) {
x = (max >= ctl->cavail) ? ctl->cavail : max-1;
@@ -149,7 +149,7 @@ static int readline(char *buf,int max,struct stream_priv_s *ctl)
ctl->cavail += x;
ctl->cput += x;
} while (1);
-
+
return retval;
}
@@ -167,7 +167,7 @@ static int readresp(struct stream_priv_s* ctl,char* rsp)
if (readline(response,256,ctl) == -1)
return 0;
-
+
r = atoi(response)/100;
if(rsp) strcpy(rsp,response);
@@ -203,12 +203,12 @@ static int FtpSendCmd(const char *cmd, struct stream_priv_s *nControl,char* rsp)
mp_msg(MSGT_OPEN,MSGL_ERR, "[ftp] write error: %s\n",strerror(errno));
return 0;
}
-
+
cmd += s;
l -= s;
}
-
- if (hascrlf)
+
+ if (hascrlf)
return readresp(nControl,rsp);
else
return FtpSendCmd("\r\n", nControl, rsp);
@@ -225,9 +225,9 @@ static int FtpOpenPort(struct stream_priv_s* p) {
mp_msg(MSGT_OPEN,MSGL_WARN, "[ftp] command 'PASV' failed: %s\n",rsp_txt);
return 0;
}
-
+
par = strchr(rsp_txt,'(');
-
+
if(!par || !par[0] || !par[1]) {
mp_msg(MSGT_OPEN,MSGL_ERR, "[ftp] invalid server response: %s ??\n",rsp_txt);
return 0;
@@ -282,7 +282,7 @@ static int fill_buffer(stream_t *s, char* buffer, int max_len){
if(s->fd < 0 && !FtpOpenData(s,s->pos))
return -1;
-
+
if(!fd_can_read(s->fd, 15)) {
mp_msg(MSGT_OPEN,MSGL_ERR, "[ftp] read timed out\n");
return -1;
@@ -314,13 +314,13 @@ static int seek(stream_t *s,off_t newpos) {
if(s->fd >= 0) {
static const char pre_cmd[]={TELNET_IAC,TELNET_IP,TELNET_IAC,TELNET_SYNCH};
//int fl;
-
+
// First close the fd
closesocket(s->fd);
s->fd = 0;
-
+
// Send send the telnet sequence needed to make the server react
-
+
// Dunno if this is really needed, lftp have it. I let
// it here in case it turn out to be needed on some other OS
//fl=fcntl(p->handle,F_GETFL);
@@ -329,7 +329,7 @@ static int seek(stream_t *s,off_t newpos) {
// send only first byte as OOB due to OOB braindamage in many unices
send(p->handle,pre_cmd,1,MSG_OOB);
send(p->handle,pre_cmd+1,sizeof(pre_cmd)-1,0);
-
+
//fcntl(p->handle,F_SETFL,fl);
// Get the 426 Transfer aborted
@@ -387,7 +387,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
// Open the control connection
p->handle = connect2Server(p->host,p->port,1);
-
+
if(p->handle < 0) {
m_struct_free(&stream_opts,opts);
return STREAM_ERROR;
@@ -422,7 +422,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
close_f(stream);
return STREAM_ERROR;
}
-
+
// Set the transfer type
resp = FtpSendCmd("TYPE I",p,rsp_txt);
if(resp != 2) {
diff --git a/stream/stream_live555.c b/stream/stream_live555.c
index 13b5022883..619a8d90af 100644
--- a/stream/stream_live555.c
+++ b/stream/stream_live555.c
@@ -71,7 +71,7 @@ static int open_live_sdp(stream_t *stream,int mode, void* opts, int* file_format
return STREAM_ERROR;
}
- len=lseek(f,0,SEEK_END);
+ len=lseek(f,0,SEEK_END);
lseek(f,0,SEEK_SET);
if(len == -1)
return STREAM_ERROR;
diff --git a/stream/stream_mf.c b/stream/stream_mf.c
index 3a5be8a47f..17fcf344f8 100644
--- a/stream/stream_mf.c
+++ b/stream/stream_mf.c
@@ -33,7 +33,7 @@ mf_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
{
stream->type = STREAMTYPE_MF;
*file_format = DEMUXER_TYPE_MF;
-
+
return STREAM_OK;
}
@@ -42,7 +42,7 @@ const stream_info_t stream_info_mf = {
"mf",
"Benjamin Zores, Albeu",
"",
- mf_stream_open,
+ mf_stream_open,
{ "mf", NULL },
NULL,
1
diff --git a/stream/stream_netstream.c b/stream/stream_netstream.c
index 734c1f6412..ea410c41e7 100644
--- a/stream/stream_netstream.c
+++ b/stream/stream_netstream.c
@@ -97,7 +97,7 @@ static int lock_fd(int fd) {
lock.l_type = F_WRLCK;
mp_msg(MSGT_STREAM,MSGL_DBG2, "Lock (%d)\n",getpid());
- do {
+ do {
if(fcntl(fd,F_SETLKW,&lock)) {
if(errno == EAGAIN) continue;
mp_msg(MSGT_STREAM,MSGL_ERR, "Failed to get the lock: %s\n",
@@ -161,7 +161,7 @@ static mp_net_stream_packet_t* send_net_stream_cmd(stream_t *s,uint16_t cmd,char
free(pack);
return NULL;
}
-
+
mp_msg(MSGT_STREAM,MSGL_ERR, "Unknown response to %d: %d\n",cmd,pack->cmd);
free(pack);
return NULL;
@@ -191,9 +191,9 @@ static int fill_buffer(stream_t *s, char* buffer, int max_len){
static int seek(stream_t *s,off_t newpos) {
uint64_t pos = le2me_64((uint64_t)newpos);
mp_net_stream_packet_t* pack;
-
+
pack = send_net_stream_cmd(s,NET_STREAM_SEEK,(char*)&pos,8);
- if(!pack) {
+ if(!pack) {
return 0;
}
s->pos = newpos;
@@ -203,15 +203,15 @@ static int seek(stream_t *s,off_t newpos) {
static int net_stream_reset(struct stream_st *s) {
mp_net_stream_packet_t* pack;
-
- pack = send_net_stream_cmd(s,NET_STREAM_RESET,NULL,0);
+
+ pack = send_net_stream_cmd(s,NET_STREAM_RESET,NULL,0);
if(!pack) {
return 0;
}
free(pack);
return 1;
}
-
+
static int control(struct stream_st *s,int cmd,void* arg) {
switch(cmd) {
case STREAM_CTRL_RESET:
@@ -222,7 +222,7 @@ static int control(struct stream_st *s,int cmd,void* arg) {
static void close_s(struct stream_st *s) {
mp_net_stream_packet_t* pack;
-
+
pack = send_net_stream_cmd(s,NET_STREAM_CLOSE,NULL,0);
if(pack)
free(pack);
@@ -260,14 +260,14 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
if(!pack) {
goto error;
}
-
- if(pack->len != sizeof(mp_net_stream_packet_t) +
+
+ if(pack->len != sizeof(mp_net_stream_packet_t) +
sizeof(mp_net_stream_opened_t)) {
mp_msg(MSGT_OPEN,MSGL_ERR, "Invalid open response packet len (%d bytes)\n",pack->len);
free(pack);
goto error;
}
-
+
opened = (mp_net_stream_opened_t*)pack->data;
net_stream_opened_2_me(opened);
diff --git a/stream/stream_netstream.h b/stream/stream_netstream.h
index 6ae46cabef..52e5cf211e 100644
--- a/stream/stream_netstream.h
+++ b/stream/stream_netstream.h
@@ -73,9 +73,9 @@ static int net_read(int fd, char* buf, int len) {
static mp_net_stream_packet_t* read_packet(int fd) {
uint16_t len;
- mp_net_stream_packet_t* pack =
+ mp_net_stream_packet_t* pack =
(mp_net_stream_packet_t*)malloc(sizeof(mp_net_stream_packet_t));
-
+
if(!net_read(fd,(char*)pack,sizeof(mp_net_stream_packet_t))) {
free(pack);
return NULL;
@@ -124,12 +124,12 @@ static int net_write(int fd, char* buf, int len) {
static int write_packet(int fd, uint8_t cmd,char* data,int len) {
mp_net_stream_packet_t* pack = malloc(len + sizeof(mp_net_stream_packet_t));
-
+
if(len > 0 && data)
memcpy(pack->data,data,len);
pack->len = len + sizeof(mp_net_stream_packet_t);
pack->cmd = cmd;
-
+
// printf("Write packet %d %d (%p) %d\n",fd,cmd,data,len);
pack->len = le2me_16(pack->len);
if(net_write(fd,(char*)pack,pack->len)) {
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c
index 8cc0eef6a0..4c1524603f 100644
--- a/stream/stream_pvr.c
+++ b/stream/stream_pvr.c
@@ -142,7 +142,7 @@ pvr_init (void)
{
struct pvr_t *pvr = NULL;
- pvr = calloc (1, sizeof (struct pvr_t));
+ pvr = calloc (1, sizeof (struct pvr_t));
pvr->dev_fd = -1;
pvr->video_dev = strdup (PVR_DEFAULT_DEVICE);
@@ -174,7 +174,7 @@ pvr_init (void)
pvr->bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR;
pvr->bitrate_peak = 9600000;
pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS;
-
+
return pvr;
}
@@ -187,7 +187,7 @@ pvr_uninit (struct pvr_t *pvr)
/* close device */
if (pvr->dev_fd)
close (pvr->dev_fd);
-
+
if (pvr->video_dev)
free (pvr->video_dev);
@@ -196,7 +196,7 @@ pvr_uninit (struct pvr_t *pvr)
if (pvr->param_channel)
free (pvr->param_channel);
-
+
free (pvr);
}
@@ -220,7 +220,7 @@ copycreate_stationlist (stationlist_t *stationlist, int num)
free (stationlist->list);
stationlist->list = NULL;
}
-
+
stationlist->total = 0;
stationlist->enabled = 0;
stationlist->used = 0;
@@ -233,7 +233,7 @@ copycreate_stationlist (stationlist_t *stationlist, int num)
LOG_LEVEL_V4L2);
return -1;
}
-
+
/* transport the channel list data to our extented struct */
stationlist->total = num;
av_strlcpy (stationlist->name, chanlists[chantab].name, PVR_STATION_NAME_SIZE);
@@ -257,7 +257,7 @@ print_all_stations (struct pvr_t *pvr)
{
int i;
- if (!pvr || !pvr->stationlist.list)
+ if (!pvr || !pvr->stationlist.list)
return -1;
for (i = 0; i < pvr->stationlist.total; i++)
@@ -298,7 +298,7 @@ set_station (struct pvr_t *pvr, const char *station,
{
int i;
- if (!pvr || !pvr->stationlist.list)
+ if (!pvr || !pvr->stationlist.list)
return -1;
if (0 >= pvr->stationlist.total || (!channel && !freq))
@@ -326,7 +326,7 @@ set_station (struct pvr_t *pvr, const char *station,
pvr->stationlist.list[i].enabled = 1;
pvr->stationlist.enabled++;
}
-
+
if (station)
av_strlcpy (pvr->stationlist.list[i].station,
station, PVR_STATION_NAME_SIZE);
@@ -357,7 +357,7 @@ set_station (struct pvr_t *pvr, const char *station,
if (pvr->stationlist.total < i)
{
/**
- * we have to extend the stationlist about
+ * we have to extend the stationlist about
* an arbitrary size, even though this path is not performance critical
*/
pvr->stationlist.total += 10;
@@ -418,7 +418,7 @@ parse_setup_stationlist (struct pvr_t *pvr)
{
int i;
- if (!pvr)
+ if (!pvr)
return -1;
/* Create our station/channel list */
@@ -442,11 +442,11 @@ parse_setup_stationlist (struct pvr_t *pvr)
else
{
mp_msg (MSGT_OPEN, MSGL_INFO,
- "%s select channel list %s, entries %d\n", LOG_LEVEL_V4L2,
+ "%s select channel list %s, entries %d\n", LOG_LEVEL_V4L2,
chanlists[chantab].name, chanlists[chantab].count);
}
}
-
+
if (0 > chantab)
{
mp_msg (MSGT_OPEN, MSGL_FATAL,
@@ -463,7 +463,7 @@ parse_setup_stationlist (struct pvr_t *pvr)
}
/* Handle user channel mappings */
- if (stream_tv_defaults.channels)
+ if (stream_tv_defaults.channels)
{
char channel[PVR_STATION_NAME_SIZE];
char station[PVR_STATION_NAME_SIZE];
@@ -471,7 +471,7 @@ parse_setup_stationlist (struct pvr_t *pvr)
disable_all_stations (pvr);
- while (*channels)
+ while (*channels)
{
char *tmp = *(channels++);
char *sep = strchr (tmp, '-');
@@ -493,17 +493,17 @@ parse_setup_stationlist (struct pvr_t *pvr)
* channel number here
*/
if ((freq = atoi (channel)) <= 1000)
- freq = -1;
+ freq = -1;
if (set_station (pvr, station, (freq <= 0) ? channel : NULL, freq) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
- "%s Unable to set user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Unable to set user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
channel, freq, station);
}
}
}
-
+
return print_all_stations (pvr);
}
@@ -516,7 +516,7 @@ get_v4l2_freq (struct pvr_t *pvr)
if (!pvr)
return -1;
-
+
if (pvr->dev_fd < 0)
return -1;
@@ -549,10 +549,10 @@ set_v4l2_freq (struct pvr_t *pvr)
{
struct v4l2_frequency vf;
struct v4l2_tuner vt;
-
+
if (!pvr)
return -1;
-
+
if (0 >= pvr->freq)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -616,9 +616,9 @@ set_v4l2_freq (struct pvr_t *pvr)
}
static int
-set_station_by_step (struct pvr_t *pvr, int step, int v4lAction)
+set_station_by_step (struct pvr_t *pvr, int step, int v4lAction)
{
- if (!pvr || !pvr->stationlist.list)
+ if (!pvr || !pvr->stationlist.list)
return -1;
if (pvr->stationlist.enabled >= abs (step))
@@ -638,7 +638,7 @@ set_station_by_step (struct pvr_t *pvr, int step, int v4lAction)
if (!pvr->stationlist.list[chidx].enabled)
{
mp_msg (MSGT_OPEN, MSGL_DBG2,
- "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
pvr->stationlist.list[chidx].name,
pvr->stationlist.list[chidx].freq,
pvr->stationlist.list[chidx].station);
@@ -653,7 +653,7 @@ set_station_by_step (struct pvr_t *pvr, int step, int v4lAction)
pvr->chan_idx = chidx;
mp_msg (MSGT_OPEN, MSGL_INFO,
- "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
pvr->stationlist.list[chidx].name,
pvr->stationlist.list[chidx].freq,
pvr->stationlist.list[chidx].station);
@@ -665,7 +665,7 @@ set_station_by_step (struct pvr_t *pvr, int step, int v4lAction)
}
mp_msg (MSGT_OPEN, MSGL_ERR,
- "%s Ooops couldn't set freq by channel entry step %d to current %d, enabled %d\n", LOG_LEVEL_V4L2,
+ "%s Ooops couldn't set freq by channel entry step %d to current %d, enabled %d\n", LOG_LEVEL_V4L2,
step, pvr->chan_idx, pvr->stationlist.enabled);
return -1;
@@ -677,7 +677,7 @@ set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel,
{
int i = 0;
- if (!pvr || !pvr->stationlist.list)
+ if (!pvr || !pvr->stationlist.list)
return -1;
if (0 >= pvr->stationlist.enabled)
@@ -698,7 +698,7 @@ set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel,
if (!pvr->stationlist.list[i].enabled)
{
mp_msg (MSGT_OPEN, MSGL_WARN,
- "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
pvr->stationlist.list[i].name,
pvr->stationlist.list[i].freq,
pvr->stationlist.list[i].station);
@@ -723,11 +723,11 @@ set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel,
if (!pvr->stationlist.list[i].enabled)
{
mp_msg (MSGT_OPEN, MSGL_WARN,
- "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
pvr->stationlist.list[i].name,
pvr->stationlist.list[i].freq,
pvr->stationlist.list[i].station);
-
+
return -1;
}
@@ -751,7 +751,7 @@ set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel,
}
mp_msg (MSGT_OPEN, MSGL_INFO,
- "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
+ "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2,
pvr->stationlist.list[i].name,
pvr->stationlist.list[i].freq,
pvr->stationlist.list[i].station);
@@ -762,12 +762,12 @@ set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel,
return (pvr->freq > 0) ? 0 : -1;
}
-static int
+static int
force_freq_step (struct pvr_t *pvr, int step)
{
int freq;
- if (!pvr)
+ if (!pvr)
return -1;
freq = pvr->freq+step;
@@ -775,14 +775,14 @@ force_freq_step (struct pvr_t *pvr, int step)
if (freq)
{
mp_msg (MSGT_OPEN, MSGL_INFO,
- "%s Force Frequency %d + %d = %d \n", LOG_LEVEL_V4L2,
+ "%s Force Frequency %d + %d = %d \n", LOG_LEVEL_V4L2,
pvr->freq, step, freq);
pvr->freq = freq;
return set_v4l2_freq (pvr);
}
-
+
return -1;
}
@@ -876,7 +876,7 @@ parse_encoder_options (struct pvr_t *pvr)
break;
}
}
-
+
else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_LAYER_2)
{
switch (pvr_param_audio_bitrate)
@@ -979,7 +979,7 @@ parse_encoder_options (struct pvr_t *pvr)
}
}
}
-
+
/* -pvr amode=x */
if (pvr_param_audio_mode)
{
@@ -1032,7 +1032,7 @@ static void
add_v4l2_ext_control (struct v4l2_ext_control *ctrl,
uint32_t id, int32_t value)
{
- ctrl->id = id;
+ ctrl->id = id;
ctrl->value = value;
}
@@ -1042,15 +1042,15 @@ set_encoder_settings (struct pvr_t *pvr)
struct v4l2_ext_control *ext_ctrl = NULL;
struct v4l2_ext_controls ctrls;
uint32_t count = 0;
-
+
if (!pvr)
return -1;
-
+
if (pvr->dev_fd < 0)
return -1;
ext_ctrl = (struct v4l2_ext_control *)
- malloc (PVR_MAX_CONTROLS * sizeof (struct v4l2_ext_control));
+ malloc (PVR_MAX_CONTROLS * sizeof (struct v4l2_ext_control));
add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_VIDEO_ASPECT,
pvr->aspect);
@@ -1095,19 +1095,19 @@ set_encoder_settings (struct pvr_t *pvr)
pvr->stream_type);
/* set new encoding settings */
- ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
- ctrls.count = count;
+ ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
+ ctrls.count = count;
ctrls.controls = ext_ctrl;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR, "%s Error setting MPEG controls (%s).\n",
LOG_LEVEL_ENCODER, strerror (errno));
- free (ext_ctrl);
+ free (ext_ctrl);
return -1;
}
- free (ext_ctrl);
+ free (ext_ctrl);
return 0;
}
@@ -1129,12 +1129,12 @@ parse_v4l2_tv_options (struct pvr_t *pvr)
if (stream_tv_defaults.freq)
{
mp_msg (MSGT_OPEN, MSGL_HINT,
- "%s tv param freq %s is overwritten by channel setting freq %d\n", LOG_LEVEL_V4L2,
+ "%s tv param freq %s is overwritten by channel setting freq %d\n", LOG_LEVEL_V4L2,
stream_tv_defaults.freq, pvr->freq);
}
}
}
-
+
if (pvr->freq < 0 && stream_tv_defaults.freq)
{
mp_msg (MSGT_OPEN, MSGL_HINT, "%s tv param freq %s is used directly\n",
@@ -1148,32 +1148,32 @@ parse_v4l2_tv_options (struct pvr_t *pvr)
LOG_LEVEL_V4L2, stream_tv_defaults.freq);
}
}
-
+
if (stream_tv_defaults.device)
{
if (pvr->video_dev)
free (pvr->video_dev);
pvr->video_dev = strdup (stream_tv_defaults.device);
}
-
+
if (stream_tv_defaults.noaudio)
pvr->mute = stream_tv_defaults.noaudio;
if (stream_tv_defaults.input)
pvr->input = stream_tv_defaults.input;
-
+
if (stream_tv_defaults.normid)
pvr->normid = stream_tv_defaults.normid;
-
+
if (stream_tv_defaults.brightness)
pvr->brightness = stream_tv_defaults.brightness;
-
+
if (stream_tv_defaults.contrast)
pvr->contrast = stream_tv_defaults.contrast;
-
+
if (stream_tv_defaults.hue)
pvr->hue = stream_tv_defaults.hue;
-
+
if (stream_tv_defaults.saturation)
pvr->saturation = stream_tv_defaults.saturation;
@@ -1189,7 +1189,7 @@ set_v4l2_settings (struct pvr_t *pvr)
{
if (!pvr)
return -1;
-
+
if (pvr->dev_fd < 0)
return -1;
@@ -1217,7 +1217,7 @@ set_v4l2_settings (struct pvr_t *pvr)
return -1;
}
}
-
+
/* -tv normid=x */
if (pvr->normid != -1)
{
@@ -1241,7 +1241,7 @@ set_v4l2_settings (struct pvr_t *pvr)
return -1;
}
}
-
+
/* -tv brightness=x */
if (pvr->brightness != 0)
{
@@ -1253,7 +1253,7 @@ set_v4l2_settings (struct pvr_t *pvr)
ctrl.value = 0;
if (ctrl.value > 255)
ctrl.value = 255;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -1274,7 +1274,7 @@ set_v4l2_settings (struct pvr_t *pvr)
ctrl.value = 0;
if (ctrl.value > 127)
ctrl.value = 127;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -1295,7 +1295,7 @@ set_v4l2_settings (struct pvr_t *pvr)
ctrl.value = -128;
if (ctrl.value > 127)
ctrl.value = 127;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -1304,7 +1304,7 @@ set_v4l2_settings (struct pvr_t *pvr)
return -1;
}
}
-
+
/* -tv saturation=x */
if (pvr->saturation != 0)
{
@@ -1316,7 +1316,7 @@ set_v4l2_settings (struct pvr_t *pvr)
ctrl.value = 0;
if (ctrl.value > 127)
ctrl.value = 127;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -1325,7 +1325,7 @@ set_v4l2_settings (struct pvr_t *pvr)
return -1;
}
}
-
+
/* -tv width=x:height=y */
if (pvr->width && pvr->height)
{
@@ -1356,7 +1356,7 @@ set_v4l2_settings (struct pvr_t *pvr)
if (0 < pvr->freq)
return set_v4l2_freq (pvr) ;
-
+
return 0;
}
@@ -1367,13 +1367,13 @@ v4l2_list_capabilities (struct pvr_t *pvr)
struct v4l2_standard vs;
struct v4l2_input vin;
int err = 0;
-
+
if (!pvr)
return -1;
if (pvr->dev_fd < 0)
return -1;
-
+
/* list available video inputs */
vin.index = 0;
err = 1;
@@ -1440,7 +1440,7 @@ v4l2_display_settings (struct pvr_t *pvr)
struct v4l2_input vin;
v4l2_std_id std;
int input;
-
+
if (!pvr)
return -1;
@@ -1516,7 +1516,7 @@ pvr_stream_close (stream_t *stream)
if (!stream)
return;
-
+
pvr = (struct pvr_t *) stream->priv;
pvr_uninit (pvr);
}
@@ -1530,14 +1530,14 @@ pvr_stream_read (stream_t *stream, char *buffer, int size)
if (!stream || !buffer)
return 0;
-
+
pvr = (struct pvr_t *) stream->priv;
fd = pvr->dev_fd;
pos = 0;
if (fd < 0)
return 0;
-
+
while (pos < size)
{
pfds[0].fd = fd;
@@ -1561,7 +1561,7 @@ pvr_stream_read (stream_t *stream, char *buffer, int size)
"%s read (%d) bytes\n", LOG_LEVEL_PVR, pos);
}
}
-
+
if (!pos)
mp_msg (MSGT_OPEN, MSGL_ERR, "%s read %d bytes\n", LOG_LEVEL_PVR, pos);
@@ -1574,10 +1574,10 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
struct v4l2_capability vcap;
struct v4l2_ext_controls ctrls;
struct pvr_t *pvr = NULL;
-
+
if (mode != STREAM_READ)
return STREAM_UNSUPPORTED;
-
+
pvr = pvr_init ();
/**
@@ -1588,10 +1588,10 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
pvr->param_channel = strdup (stream->url + 6);
else if (stream_tv_defaults.channel && strlen (stream_tv_defaults.channel))
pvr->param_channel = strdup (stream_tv_defaults.channel);
-
+
parse_v4l2_tv_options (pvr);
parse_encoder_options (pvr);
-
+
/* open device */
pvr->dev_fd = open (pvr->video_dev, O_RDWR);
mp_msg (MSGT_OPEN, MSGL_INFO,
@@ -1603,7 +1603,7 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
pvr_uninit (pvr);
return STREAM_ERROR;
}
-
+
/* query capabilities (i.e test V4L2 support) */
if (ioctl (pvr->dev_fd, VIDIOC_QUERYCAP, &vcap) < 0)
{
@@ -1628,10 +1628,10 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
}
/* check for device hardware MPEG encoding capability */
- ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
- ctrls.count = 0;
+ ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
+ ctrls.count = 0;
ctrls.controls = NULL;
-
+
if (ioctl (pvr->dev_fd, VIDIOC_G_EXT_CTRLS, &ctrls) < 0)
{
mp_msg (MSGT_OPEN, MSGL_ERR,
@@ -1647,7 +1647,7 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
pvr_uninit (pvr);
return STREAM_ERROR;
}
-
+
/* apply V4L2 settings */
if (set_v4l2_settings (pvr) == -1)
{
@@ -1665,7 +1665,7 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
pvr_uninit (pvr);
return STREAM_ERROR;
}
-
+
/* display current V4L2 settings */
if (v4l2_display_settings (pvr) == -1)
{
@@ -1679,7 +1679,7 @@ pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
stream->type = STREAMTYPE_PVR;
stream->fill_buffer = pvr_stream_read;
stream->close = pvr_stream_close;
-
+
return STREAM_OK;
}
@@ -1692,7 +1692,7 @@ pvr_get_current_stationname (stream_t *stream)
if (!stream || stream->type != STREAMTYPE_PVR)
return NULL;
-
+
pvr = (struct pvr_t *) stream->priv;
if (pvr->stationlist.list &&
@@ -1774,7 +1774,7 @@ const stream_info_t stream_info_pvr = {
"pvr",
"Benjamin Zores",
"",
- pvr_stream_open,
+ pvr_stream_open,
{ "pvr", NULL },
NULL,
1
diff --git a/stream/stream_radio.c b/stream/stream_radio.c
index 9792fb142c..49d75090a9 100644
--- a/stream/stream_radio.c
+++ b/stream/stream_radio.c
@@ -654,17 +654,17 @@ static const radio_driver_t radio_driver_bsdbt848={
};
#endif /* CONFIG_RADIO_BSDBT848 */
-static inline int init_frac(radio_priv_t* priv){
+static inline int init_frac(radio_priv_t* priv){
return priv->driver->init_frac(priv);
}
-static inline int set_frequency(radio_priv_t* priv,float frequency){
+static inline int set_frequency(radio_priv_t* priv,float frequency){
if ((frequency<priv->rangelow)||(frequency>priv->rangehigh)){
mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongFreq,frequency);
return STREAM_ERROR;
}
if(priv->driver->set_frequency(priv,frequency)!=STREAM_OK)
return STREAM_ERROR;
-
+
#ifdef CONFIG_RADIO_CAPTURE
if(clear_buffer(priv)!=STREAM_OK){
mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_ClearBufferFailed,strerror(errno));
@@ -673,13 +673,13 @@ static inline int set_frequency(radio_priv_t* priv,float frequency){
#endif
return STREAM_OK;
}
-static inline int get_frequency(radio_priv_t* priv,float* frequency){
+static inline int get_frequency(radio_priv_t* priv,float* frequency){
return priv->driver->get_frequency(priv,frequency);
}
-static inline void set_volume(radio_priv_t* priv,int volume){
+static inline void set_volume(radio_priv_t* priv,int volume){
priv->driver->set_volume(priv,volume);
}
-static inline int get_volume(radio_priv_t* priv,int* volume){
+static inline int get_volume(radio_priv_t* priv,int* volume){
return priv->driver->get_volume(priv,volume);
}
@@ -786,11 +786,11 @@ static int grab_audio_frame(radio_priv_t *priv, char *buffer, int len)
{
int i;
mp_msg(MSGT_RADIO, MSGL_DBG3, MSGTR_RADIO_BufferString,"grab_audio_frame",priv->audio_cnt,priv->audio_drop);
- /* Cache buffer must be filled by some audio packets when playing starts.
+ /* Cache buffer must be filled by some audio packets when playing starts.
Otherwise MPlayer will quit with EOF error.
Probably, there is need more carefull checking rather than simple 'for' loop
(something like timer or similar).
-
+
1000ms delay will happen only at first buffer filling. At next call function
just fills buffer until either buffer full or no data from driver available.
*/
@@ -937,10 +937,10 @@ int radio_set_freq(struct stream_st *stream, float frequency){
int radio_step_freq(struct stream_st *stream, float step_interval){
float frequency;
radio_priv_t* priv=(radio_priv_t*)stream->priv;
-
+
if (get_frequency(priv,&frequency)!=STREAM_OK)
return 0;
-
+
frequency+=step_interval;
if (frequency>priv->rangehigh)
frequency=priv->rangehigh;
@@ -1007,7 +1007,7 @@ int radio_set_channel(struct stream_st *stream, char *channel) {
if (*channel=='\0')
mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongChannelName,channel);
-
+
if (priv->radio_channel_list) {
channel_int = strtol(channel,&endptr,10);
tmp = priv->radio_channel_list;
@@ -1076,7 +1076,7 @@ static int fill_buffer_s(struct stream_st *s, char* buffer, int max_len){
/*
- order if significant!
+ order if significant!
when no driver explicitly specified first available will be used
*/
static const radio_driver_t* radio_drivers[]={
@@ -1136,7 +1136,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
priv->driver=radio_drivers[i];
}
mp_msg(MSGT_RADIO,MSGL_V,"\n");
-
+
if(priv->driver)
mp_msg(MSGT_RADIO, MSGL_INFO, priv->driver->info);
else{
diff --git a/stream/stream_rtp.c b/stream/stream_rtp.c
index b48562fbde..b3c91e91f5 100644
--- a/stream/stream_rtp.c
+++ b/stream/stream_rtp.c
@@ -48,10 +48,10 @@ rtp_streaming_start (stream_t *stream)
streaming_ctrl = stream->streaming_ctrl;
fd = stream->fd;
-
+
if (fd < 0)
{
- fd = udp_open_socket (streaming_ctrl->url);
+ fd = udp_open_socket (streaming_ctrl->url);
if (fd < 0)
return -1;
stream->fd = fd;
@@ -62,7 +62,7 @@ rtp_streaming_start (stream_t *stream)
streaming_ctrl->prebuffer_size = 64 * 1024; /* 64 KBytes */
streaming_ctrl->buffering = 0;
streaming_ctrl->status = streaming_playing_e;
-
+
return 0;
}
@@ -71,7 +71,7 @@ rtp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
{
URL_t *url;
extern int network_bandwidth;
-
+
mp_msg (MSGT_OPEN, MSGL_INFO, "STREAM_RTP, URL: %s\n", stream->url);
stream->streaming_ctrl = streaming_ctrl_new ();
if (!stream->streaming_ctrl)
@@ -87,7 +87,7 @@ rtp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
"You must enter a port number for RTP streams!\n");
streaming_ctrl_free (stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
-
+
return STREAM_UNSUPPORTED;
}
@@ -96,13 +96,13 @@ rtp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
mp_msg (MSGT_NETWORK, MSGL_ERR, "rtp_streaming_start failed\n");
streaming_ctrl_free (stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
-
+
return STREAM_UNSUPPORTED;
}
stream->type = STREAMTYPE_STREAM;
fixup_network_stream_cache (stream);
-
+
return STREAM_OK;
}
diff --git a/stream/stream_rtsp.c b/stream/stream_rtsp.c
index 591fc1765a..336db6144c 100644
--- a/stream/stream_rtsp.c
+++ b/stream/stream_rtsp.c
@@ -78,21 +78,21 @@ rtsp_streaming_start (stream_t *stream)
port = (stream->streaming_ctrl->url->port ?
stream->streaming_ctrl->url->port :
RTSP_DEFAULT_PORT), 1);
-
+
if (fd < 0 && !stream->streaming_ctrl->url->port)
fd = connect2Server (stream->streaming_ctrl->url->hostname,
port = 7070, 1);
if (fd < 0)
return -1;
-
+
file = stream->streaming_ctrl->url->file;
if (file[0] == '/')
file++;
mrl = malloc (strlen (stream->streaming_ctrl->url->hostname)
+ strlen (file) + 16);
-
+
sprintf (mrl, "rtsp://%s:%i/%s",
stream->streaming_ctrl->url->hostname, port, file);
@@ -112,20 +112,20 @@ rtsp_streaming_start (stream_t *stream)
free (mrl);
temp--;
- } while ((redirected != 0) && (temp > 0));
+ } while ((redirected != 0) && (temp > 0));
if (!rtsp)
return -1;
stream->fd = fd;
stream->streaming_ctrl->data = rtsp;
-
+
stream->streaming_ctrl->streaming_read = rtsp_streaming_read;
stream->streaming_ctrl->streaming_seek = NULL;
stream->streaming_ctrl->prebuffer_size = 128*1024; // 640 KBytes
stream->streaming_ctrl->buffering = 1;
stream->streaming_ctrl->status = streaming_playing_e;
-
+
return 0;
}
@@ -133,7 +133,7 @@ static void
rtsp_streaming_close (struct stream_st *s)
{
rtsp_session_t *rtsp = NULL;
-
+
rtsp = (rtsp_session_t *) s->streaming_ctrl->data;
if (rtsp)
rtsp_session_end (rtsp);
@@ -144,7 +144,7 @@ rtsp_streaming_open (stream_t *stream, int mode, void *opts, int *file_format)
{
URL_t *url;
extern int index_mode;
-
+
mp_msg (MSGT_OPEN, MSGL_V, "STREAM_RTSP, URL: %s\n", stream->url);
stream->streaming_ctrl = streaming_ctrl_new ();
if (!stream->streaming_ctrl)
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index 370e599db5..17ba027687 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -35,23 +35,23 @@ static void smb_auth_fn(const char *server, const char *share,
char *password, int pwmaxlen)
{
char temp[128];
-
- strcpy(temp, "LAN");
+
+ strcpy(temp, "LAN");
if (temp[strlen(temp) - 1] == 0x0a)
temp[strlen(temp) - 1] = 0x00;
-
+
if (temp[0]) strncpy(workgroup, temp, wgmaxlen - 1);
-
- strcpy(temp, smb_username);
+
+ strcpy(temp, smb_username);
if (temp[strlen(temp) - 1] == 0x0a)
temp[strlen(temp) - 1] = 0x00;
-
+
if (temp[0]) strncpy(username, temp, unmaxlen - 1);
-
- strcpy(temp, smb_password);
+
+ strcpy(temp, smb_password);
if (temp[strlen(temp) - 1] == 0x0a)
temp[strlen(temp) - 1] = 0x00;
-
+
if (temp[0]) strncpy(password, temp, pwmaxlen - 1);
}
@@ -98,9 +98,9 @@ static int open_f (stream_t *stream, int mode, void *opts, int* file_format) {
mode_t m = 0;
off_t len;
int fd, err;
-
+
filename = stream->url;
-
+
if(mode == STREAM_READ)
m = O_RDONLY;
else if (mode == STREAM_WRITE) //who's gonna do that ?
@@ -110,27 +110,27 @@ static int open_f (stream_t *stream, int mode, void *opts, int* file_format) {
m_struct_free (&stream_opts, opts);
return STREAM_UNSUPPORTED;
}
-
+
if(!filename) {
mp_msg(MSGT_OPEN,MSGL_ERR, "[smb] Bad url\n");
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
-
+
err = smbc_init(smb_auth_fn, 1);
if (err < 0) {
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_SMBInitError,err);
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
-
+
fd = smbc_open(filename, m,0644);
- if (fd < 0) {
+ if (fd < 0) {
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_SMBFileNotFound, filename);
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
-
+
stream->flags = mode;
len = 0;
if(mode == STREAM_READ) {
@@ -148,7 +148,7 @@ static int open_f (stream_t *stream, int mode, void *opts, int* file_format) {
stream->write_buffer = write_buffer;
stream->close = close_f;
stream->control = control;
-
+
m_struct_free(&stream_opts, opts);
return STREAM_OK;
}
diff --git a/stream/stream_tv.c b/stream/stream_tv.c
index 674ed362b0..3db6195dcf 100644
--- a/stream/stream_tv.c
+++ b/stream/stream_tv.c
@@ -121,7 +121,7 @@ const stream_info_t stream_info_tv = {
"tv",
"Benjamin Zores, Albeu",
"",
- tv_stream_open,
+ tv_stream_open,
{ "tv", NULL },
&stream_opts,
1
diff --git a/stream/stream_udp.c b/stream/stream_udp.c
index c366d8e4a9..5b901cf543 100644
--- a/stream/stream_udp.c
+++ b/stream/stream_udp.c
@@ -40,10 +40,10 @@ udp_streaming_start (stream_t *stream)
streaming_ctrl = stream->streaming_ctrl;
fd = stream->fd;
-
+
if (fd < 0)
{
- fd = udp_open_socket (streaming_ctrl->url);
+ fd = udp_open_socket (streaming_ctrl->url);
if (fd < 0)
return -1;
stream->fd = fd;
@@ -54,7 +54,7 @@ udp_streaming_start (stream_t *stream)
streaming_ctrl->prebuffer_size = 64 * 1024; /* 64 KBytes */
streaming_ctrl->buffering = 0;
streaming_ctrl->status = streaming_playing_e;
-
+
return 0;
}
@@ -63,7 +63,7 @@ udp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
{
URL_t *url;
extern int network_bandwidth;
-
+
mp_msg (MSGT_OPEN, MSGL_INFO, "STREAM_UDP, URL: %s\n", stream->url);
stream->streaming_ctrl = streaming_ctrl_new ();
if (!stream->streaming_ctrl)
@@ -79,7 +79,7 @@ udp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
"You must enter a port number for UDP streams!\n");
streaming_ctrl_free (stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
-
+
return STREAM_UNSUPPORTED;
}
@@ -88,13 +88,13 @@ udp_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
mp_msg (MSGT_NETWORK, MSGL_ERR, "udp_streaming_start failed\n");
streaming_ctrl_free (stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
-
+
return STREAM_UNSUPPORTED;
}
stream->type = STREAMTYPE_STREAM;
fixup_network_stream_cache (stream);
-
+
return STREAM_OK;
}
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 34844bcea9..53e82f7da2 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -20,9 +20,9 @@
#include <errno.h>
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
-#include "vcd_read_fbsd.h"
+#include "vcd_read_fbsd.h"
#elif defined(__APPLE__)
-#include "vcd_read_darwin.h"
+#include "vcd_read_darwin.h"
#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include "vcd_read_win32.h"
#else
@@ -111,7 +111,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
#else
f=open(p->device,O_RDONLY);
#endif
- if(f<0){
+ if(f<0){
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device);
m_struct_free(&stream_opts,opts);
return STREAM_ERROR;
diff --git a/stream/stream_vstream.c b/stream/stream_vstream.c
index 4d0d972ebf..ff173855f5 100644
--- a/stream/stream_vstream.c
+++ b/stream/stream_vstream.c
@@ -150,7 +150,7 @@ static int open_s(stream_t *stream, int mode, void* opts, int* file_format) {
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
-
+
stream->start_pos = 0;
stream->end_pos = vstream_streamsize();
mp_msg(MSGT_OPEN, MSGL_DBG2, "Tivo stream size is %d\n", stream->end_pos);
diff --git a/stream/tcp.c b/stream/tcp.c
index ac3165b1a7..b299e9d66f 100644
--- a/stream/tcp.c
+++ b/stream/tcp.c
@@ -42,7 +42,7 @@ int network_prefer_ipv4 = 0;
static const char *af2String(int af) {
switch (af) {
case AF_INET: return "AF_INET";
-
+
#ifdef HAVE_AF_INET6
case AF_INET6: return "AF_INET6";
#endif
@@ -74,17 +74,17 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
void *our_s_addr; // Pointer to sin_addr or sin6_addr
struct hostent *hp=NULL;
char buf[255];
-
+
#if HAVE_WINSOCK2_H
unsigned long val;
int to;
#else
struct timeval to;
#endif
-
+
socket_server_fd = socket(af, SOCK_STREAM, 0);
-
-
+
+
if( socket_server_fd==-1 ) {
// mp_msg(MSGT_NETWORK,MSGL_ERR,"Failed to create %s socket:\n", af2String(af));
return TCP_ERROR_FATAL;
@@ -111,10 +111,10 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
mp_msg(MSGT_NETWORK,MSGL_ERR, MSGTR_MPDEMUX_NW_UnknownAF, af);
return TCP_ERROR_FATAL;
}
-
-
+
+
memset(&server_address, 0, sizeof(server_address));
-
+
#if HAVE_INET_PTON
if (inet_pton(af, host, our_s_addr)!=1)
#elif HAVE_INET_ATON
@@ -124,7 +124,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
#endif
{
if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ResolvingHostForAF, host, af2String(af));
-
+
#ifdef HAVE_GETHOSTBYNAME2
hp=(struct hostent*)gethostbyname2( host, af );
#else
@@ -134,7 +134,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
if(verb) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_CantResolv, af2String(af), host);
return TCP_ERROR_FATAL;
}
-
+
memcpy( our_s_addr, (void*)hp->h_addr_list[0], hp->h_length );
}
#if HAVE_WINSOCK2_H
@@ -143,14 +143,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
memcpy( our_s_addr, (void*)&addr, sizeof(addr) );
}
#endif
-
+
switch (af) {
case AF_INET:
server_address.four.sin_family=af;
- server_address.four.sin_port=htons(port);
+ server_address.four.sin_port=htons(port);
server_address_size = sizeof(server_address.four);
break;
-#ifdef HAVE_AF_INET6
+#ifdef HAVE_AF_INET6
case AF_INET6:
server_address.six.sin6_family=af;
server_address.six.sin6_port=htons(port);
@@ -226,7 +226,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnectError,strerror(err));
return TCP_ERROR_PORT;
}
-
+
return socket_server_fd;
}
@@ -241,15 +241,15 @@ connect2Server(char *host, int port, int verb) {
int r;
int s = TCP_ERROR_FATAL;
- r = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET:AF_INET6,verb);
+ r = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET:AF_INET6,verb);
if (r >= 0) return r;
s = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET6:AF_INET,verb);
if (s == TCP_ERROR_FATAL) return r;
return s;
-#else
+#else
return connect2Server_with_af(host, port, AF_INET,verb);
#endif
-
+
}
diff --git a/stream/tv.c b/stream/tv.c
index 7e8ae530d4..240596b32d 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -962,7 +962,7 @@ int tv_step_channel(tvi_handle_t *tvh, int direction) {
tv_channel_current = tv_channel_current->next;
else
tv_channel_current = tv_channel_list;
-
+
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
diff --git a/stream/tv.h b/stream/tv.h
index c7ffae032c..5a38df690d 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -51,21 +51,21 @@ typedef struct tv_param_s {
int scan_threshold;
float scan_period;
/**
- Terminate stream with video renderer instead of Null renderer
+ Terminate stream with video renderer instead of Null renderer
Will help if video freezes but audio does not.
May not work with -vo directx and -vf crop combination.
*/
int hidden_video_renderer;
/**
For VIVO cards VP pin have to be rendered too.
- This tweak will cause VidePort pin stream to be terminated with video renderer
+ This tweak will cause VidePort pin stream to be terminated with video renderer
instead of removing it from graph.
Use if your card have vp pin and video is still choppy.
May not work with -vo directx and -vf crop combination.
*/
int hidden_vp_renderer;
/**
- Use system clock as sync source instead of default graph clock (usually the clock
+ Use system clock as sync source instead of default graph clock (usually the clock
from one of live sources in graph.
*/
int system_clock;
@@ -77,9 +77,9 @@ typedef struct tv_param_s {
*/
int normalize_audio_chunks;
} tv_param_t;
-
+
extern tv_param_t stream_tv_defaults;
-
+
typedef struct tvi_info_s
{
struct tvi_handle_s * (*tvi_init)(tv_param_t* tv_param);
@@ -201,9 +201,9 @@ typedef struct {
//tvi_* ioctl (not tvi_vbi.c !!!)
#define TVI_CONTROL_VBI_INIT 0x501 ///< vbi init
-/*
- TELETEXT controls (through tv_teletext_control() )
- NOTE:
+/*
+ TELETEXT controls (through tv_teletext_control() )
+ NOTE:
_SET_ should be _GET_ +1
_STEP_ should be _GET_ +2
*/
@@ -314,7 +314,7 @@ typedef struct tt_char_s{
typedef struct tt_link_s{
int pagenum; ///< page number
int subpagenum; ///< subpage number
-} tt_link_t;
+} tt_link_t;
typedef struct tt_page_s{
int pagenum; ///< page number
diff --git a/stream/tvi_bsdbt848.c b/stream/tvi_bsdbt848.c
index 1926a5d45b..431e8f9100 100644
--- a/stream/tvi_bsdbt848.c
+++ b/stream/tvi_bsdbt848.c
@@ -5,7 +5,7 @@
Still in (active) development!
v1.1 Mar 13 2002 Fully functional, need to move ring buffer to
- the kernel driver.
+ the kernel driver.
v1.0 Feb 19 2002 First Release, need to add support for changing
audio parameters.
*/
@@ -156,12 +156,12 @@ gettimeofday(&curtime, NULL);
if(G_private->framebuf[G_private->curpaintframe].dirty == TRUE)
{
- memcpy(G_private->framebuf[G_private->curpaintframe].buf,
+ memcpy(G_private->framebuf[G_private->curpaintframe].buf,
G_private->livebuf, G_private->framebufsize);
G_private->framebuf[G_private->curpaintframe].dirty = FALSE;
- G_private->framebuf[G_private->curpaintframe].timestamp =
+ G_private->framebuf[G_private->curpaintframe].timestamp =
curtime.tv_sec + curtime.tv_usec*.000001;
G_private->curpaintframe++;
@@ -183,7 +183,7 @@ static tvi_handle_t *tvi_init_bsdbt848(tv_param_t* tv_param)
if(!tvh)
return NULL;
priv=(priv_t*)tvh->priv;
- /*
+ /*
if user needs to specify both /dev/bktr<n> and /dev/tuner<n>
it can do this with "-tv device=/dev/bktr1,/dev/tuner1"
*/
@@ -240,12 +240,12 @@ static int control(priv_t *priv, int cmd, void *arg)
*(int *)arg = priv->tunerfreq;
return TVI_CONTROL_TRUE;
}
-
+
case TVI_CONTROL_TUN_SET_FREQ:
{
priv->tunerfreq = *(int *)arg;
- if(ioctl(priv->tunerfd, TVTUNER_SETFREQ, &priv->tunerfreq) < 0)
+ if(ioctl(priv->tunerfd, TVTUNER_SETFREQ, &priv->tunerfreq) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "TVTUNER_SETFREQ", strerror(errno));
return 0;
@@ -281,12 +281,12 @@ static int control(priv_t *priv, int cmd, void *arg)
*(int *)arg = priv->input;
return TVI_CONTROL_TRUE;
}
-
+
case TVI_CONTROL_SPC_SET_INPUT:
{
priv->input = getinput(*(int *)arg);
- if(ioctl(priv->btfd, METEORSINPUT, &priv->input) < 0)
+ if(ioctl(priv->btfd, METEORSINPUT, &priv->input) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
return 0;
@@ -315,7 +315,7 @@ static int control(priv_t *priv, int cmd, void *arg)
{
int dspspeed = *(int *)arg;
- if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
+ if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848InvalidAudioRate, strerror(errno));
return TVI_CONTROL_FALSE;
@@ -354,7 +354,7 @@ static int control(priv_t *priv, int cmd, void *arg)
priv->iformat = METEOR_FMT_AUTOMODE;
- if(req_mode == TV_NORM_PAL)
+ if(req_mode == TV_NORM_PAL)
{
priv->iformat = METEOR_FMT_PAL;
priv->maxheight = PAL_HEIGHT;
@@ -364,18 +364,18 @@ static int control(priv_t *priv, int cmd, void *arg)
if(priv->fps > priv->maxfps) priv->fps = priv->maxfps;
- if(priv->geom.rows > priv->maxheight)
+ if(priv->geom.rows > priv->maxheight)
{
priv->geom.rows = priv->maxheight;
}
- if(priv->geom.columns > priv->maxwidth)
+ if(priv->geom.columns > priv->maxwidth)
{
priv->geom.columns = priv->maxwidth;
}
}
- if(req_mode == TV_NORM_NTSC)
+ if(req_mode == TV_NORM_NTSC)
{
priv->iformat = METEOR_FMT_NTSC;
priv->maxheight = NTSC_HEIGHT;
@@ -390,12 +390,12 @@ static int control(priv_t *priv, int cmd, void *arg)
if(priv->fps > priv->maxfps) priv->fps = priv->maxfps;
- if(priv->geom.rows > priv->maxheight)
+ if(priv->geom.rows > priv->maxheight)
{
priv->geom.rows = priv->maxheight;
}
- if(priv->geom.columns > priv->maxwidth)
+ if(priv->geom.columns > priv->maxwidth)
{
priv->geom.columns = priv->maxwidth;
}
@@ -403,20 +403,20 @@ static int control(priv_t *priv, int cmd, void *arg)
if(req_mode == TV_NORM_SECAM) priv->iformat = METEOR_FMT_SECAM;
- if(ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
+ if(ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFMT", strerror(errno));
return TVI_CONTROL_FALSE;
}
-
- if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
+
+ if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSETGEO", strerror(errno));
return 0;
}
tmp_fps = priv->fps;
- if(ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
+ if(ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
return 0;
@@ -432,7 +432,7 @@ static int control(priv_t *priv, int cmd, void *arg)
return TVI_CONTROL_TRUE;
}
-
+
case TVI_CONTROL_VID_GET_FORMAT:
*(int *)arg = IMGFMT_UYVY;
return TVI_CONTROL_TRUE;
@@ -448,12 +448,12 @@ static int control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_VID_SET_WIDTH:
priv->geom.columns = *(int *)arg;
- if(priv->geom.columns > priv->maxwidth)
+ if(priv->geom.columns > priv->maxwidth)
{
priv->geom.columns = priv->maxwidth;
}
- if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
+ if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
return 0;
@@ -468,7 +468,7 @@ static int control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_VID_SET_HEIGHT:
priv->geom.rows = *(int *)arg;
- if(priv->geom.rows > priv->maxheight)
+ if(priv->geom.rows > priv->maxheight)
{
priv->geom.rows = priv->maxheight;
}
@@ -476,9 +476,9 @@ static int control(priv_t *priv, int cmd, void *arg)
if(priv->geom.rows <= priv->maxheight / 2)
{
priv->geom.oformat |= METEOR_GEO_EVEN_ONLY;
- }
+ }
- if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
+ if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
return 0;
@@ -500,7 +500,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(priv->fps > priv->maxfps) priv->fps = priv->maxfps;
- if(ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0)
+ if(ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
return 0;
@@ -557,27 +557,27 @@ if(priv->btfd < 0)
priv->videoready = FALSE;
}
-if(priv->videoready == TRUE &&
- ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
+if(priv->videoready == TRUE &&
+ ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SETEORSFMT", strerror(errno));
}
if(priv->videoready == TRUE &&
- ioctl(priv->btfd, METEORSINPUT, &priv->source) < 0)
+ ioctl(priv->btfd, METEORSINPUT, &priv->source) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
}
tmp_fps = priv->fps;
if(priv->videoready == TRUE &&
- ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
+ ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
}
if(priv->videoready == TRUE &&
- ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
+ ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSGEQ", strerror(errno));
}
@@ -632,18 +632,18 @@ priv->dspspeed = 44100;
priv->dspfmt = AFMT_S16_LE;
priv->dspbytesread = 0;
priv->dsprate = priv->dspspeed * priv->dspsamplesize/8*(priv->dspstereo+1);
-priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps *
+priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps *
(priv->dspstereo+1);
if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningDspDev, strerror(errno));
priv->dspready = FALSE;
- }
+ }
marg = (256 << 16) | 12;
-if (ioctl(priv->dspfd, SNDCTL_DSP_SETFRAGMENT, &marg ) < 0 )
+if (ioctl(priv->dspfd, SNDCTL_DSP_SETFRAGMENT, &marg ) < 0 )
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SNDCTL_DSP_SETFRAGMENT", strerror(errno));
priv->dspready = FALSE;
@@ -678,7 +678,7 @@ signal(SIGALRM, processframe);
marg = SIGUSR1;
-if(ioctl(priv->btfd, METEORSSIGNAL, &marg) < 0)
+if(ioctl(priv->btfd, METEORSSIGNAL, &marg) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
return 0;
@@ -692,7 +692,7 @@ priv->starttime = curtime.tv_sec + (curtime.tv_usec *.000001);
marg = METEOR_CAP_CONTINOUS;
-if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0)
+if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORCAPTUR", strerror(errno));
return 0;
@@ -709,7 +709,7 @@ if(priv->videoready == FALSE) return 0;
marg = METEOR_SIG_MODE_MASK;
-if(ioctl( priv->btfd, METEORSSIGNAL, &marg) < 0 )
+if(ioctl( priv->btfd, METEORSSIGNAL, &marg) < 0 )
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
return 0;
@@ -717,7 +717,7 @@ if(ioctl( priv->btfd, METEORSSIGNAL, &marg) < 0 )
marg = METEOR_CAP_STOP_CONT;
-if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 )
+if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 )
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848UnableToStopCapture, strerror(errno));
return 0;
@@ -754,7 +754,7 @@ memcpy(buffer, priv->livebuf, len);
/* PTS = 0, show the frame NOW, this routine is only used in playback mode
without audio capture .. */
-return 0;
+return 0;
}
static double grab_video_frame(priv_t *priv, char *buffer, int len)
@@ -764,7 +764,7 @@ sigset_t sa_mask;
if(priv->videoready == FALSE) return 0;
-if(priv->immediatemode == TRUE)
+if(priv->immediatemode == TRUE)
{
return grabimmediate_video_frame(priv, buffer, len);
}
@@ -806,7 +806,7 @@ gettimeofday(&curtime, NULL);
/* Get exactly one frame of audio, which forces video sync to audio.. */
-bytesread=read(priv->dspfd, buffer, len);
+bytesread=read(priv->dspfd, buffer, len);
while(bytesread < len)
{
@@ -827,13 +827,13 @@ curpts = curtime.tv_sec + curtime.tv_usec * .000001;
timeskew = priv->dspbytesread * 1.0 / priv->dsprate - (curpts-priv->starttime);
-if(timeskew > .125/priv->fps)
+if(timeskew > .125/priv->fps)
{
priv->starttime -= timeskew;
}
else
{
- if(timeskew < -.125/priv->fps)
+ if(timeskew < -.125/priv->fps)
{
priv->starttime -= timeskew;
}
@@ -852,7 +852,7 @@ struct audio_info auinf;
if(priv->dspready == FALSE) return 0;
#ifdef CONFIG_SUN_AUDIO
-if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0)
+if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "AUDIO_GETINFO", strerror(errno));
return TVI_CONTROL_FALSE;
@@ -860,7 +860,7 @@ if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0)
else
bytesavail = auinf.record.seek; /* *priv->dspsamplesize; */
#else
-if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0)
+if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0)
{
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "FIONREAD", strerror(errno));
return TVI_CONTROL_FALSE;
diff --git a/stream/tvi_def.h b/stream/tvi_def.h
index 967c15ee15..3c0ef8edb0 100644
--- a/stream/tvi_def.h
+++ b/stream/tvi_def.h
@@ -65,11 +65,11 @@ static void free_handle(tvi_handle_t *h)
/**
Fills video frame in given buffer with blue color for yv12,i420,uyvy,yuy2.
- Other formats will be filled with 0xC0
+ Other formats will be filled with 0xC0
*/
static inline void fill_blank_frame(char* buffer,int len,int fmt){
int i;
- // RGB(0,0,255) <-> YVU(41,110,240)
+ // RGB(0,0,255) <-> YVU(41,110,240)
switch(fmt){
case IMGFMT_YV12:
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 4a524852cd..37816f82cb 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -49,7 +49,7 @@
* - ATI 9200 VIVO based card
* - ATI AIW 7500
* - nVidia Ti-4400
- *
+ *
* Known bugs:
* * stream goes with 24.93 FPS (NTSC), while reporting 25 FPS (PAL) ?!
* * direct set frequency call does not work ('Insufficient Buffer' error)
@@ -97,7 +97,7 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param);
*
*---------------------------------------------------------------------------------------
*/
-/**
+/**
information about this file
*/
const tvi_info_t tvi_info_dshow = {
@@ -170,7 +170,7 @@ typedef struct {
int direct_getfreq_call; ///< 0-find frequncy from frequency table (workaround),1-direct call to get frequency
int fcc; ///< used video format code (FourCC)
- int width; ///< picture width (default: auto)
+ int width; ///< picture width (default: auto)
int height; ///< picture height (default: auto)
int channels; ///< number of audio channels (default: auto)
@@ -208,7 +208,7 @@ typedef struct __attribute__((__packed__)) {
WORD CountryCode; ///< Country code
WORD CableFreqTable; ///< index of resource with frequencies for cable channels
WORD BroadcastFreqTable; ///< index of resource with frequencies for broadcast channels
- DWORD VideoStandard; ///< used video standard
+ DWORD VideoStandard; ///< used video standard
} TRCCountryList;
/**
information about image formats
@@ -231,7 +231,7 @@ typedef struct {
static HRESULT init_ringbuffer(grabber_ringbuffer_t * rb, int buffersize,
int blocksize);
static HRESULT show_filter_info(IBaseFilter * pFilter);
-#if 0
+#if 0
//defined in current MinGW release
HRESULT STDCALL GetRunningObjectTable(DWORD, IRunningObjectTable **);
HRESULT STDCALL CreateItemMoniker(LPCOLESTR, LPCOLESTR, IMoniker **);
@@ -307,7 +307,7 @@ static const struct {
{"us-cable-hrc", 1},
{"japan-cable", 81},
//default is USA
- {NULL, 1}
+ {NULL, 1}
};
/**
@@ -441,7 +441,7 @@ DEFINE_GUID(PIN_CATEGORY_CAPTURE, 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f,
0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
DEFINE_GUID(PIN_CATEGORY_VIDEOPORT, 0xfb6c4285, 0x0353, 0x11d1, 0x90, 0x5f,
0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
-DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f,
+DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f,
0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
DEFINE_GUID(PIN_CATEGORY_VBI, 0xfb6c4284, 0x0353, 0x11d1, 0x90, 0x5f,
0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
@@ -471,7 +471,7 @@ void set_buffer_preference(int nDiv,WAVEFORMATEX* pWF,IPin* pOutPin,IPin* pInPin
prop.cbBuffer += pWF->nBlockAlign - 1;
prop.cbBuffer -= prop.cbBuffer % pWF->nBlockAlign;
prop.cbPrefix = -1;
- prop.cBuffers = -1;
+ prop.cBuffers = -1;
hr=OLE_QUERYINTERFACE(pOutPin,IID_IAMBufferNegotiation,pBN);
if(FAILED(hr))
@@ -643,7 +643,7 @@ static CSampleGrabberCB *CSampleGrabberCB_Create(grabber_ringbuffer_t *
*
*---------------------------------------------------------------------------------------
*/
-/**
+/**
Registering graph in ROT. User will be able to connect to graph from GraphEdit.
*/
static HRESULT AddToRot(IUnknown * pUnkGraph, DWORD * pdwRegister)
@@ -730,7 +730,7 @@ static void destroy_ringbuffer(grabber_ringbuffer_t * rb)
* \param buffersize size of buffer in blocks
* \param blocksize size of buffer's block
*
- * \return S_OK if success
+ * \return S_OK if success
* \return E_OUTOFMEMORY not enough memory
*
* \note routine does not allocates memory for grabber_rinbuffer_s structure
@@ -813,7 +813,7 @@ static char *physcon2str(const long lPhysicalType)
* \return system country code
*
* \remarks
- * After call to IAMTVTuner::put_CountryCode with returned value tuner switches to frequency table used in specified
+ * After call to IAMTVTuner::put_CountryCode with returned value tuner switches to frequency table used in specified
* country (which is usually larger then MPlayer's one, so workaround will work fine).
*
* \todo
@@ -863,14 +863,14 @@ static void *GetRC(HMODULE hDLL, int index)
* \param[in] nCountry - country code
* \param[in] nInputType (TunerInputCable or TunerInputAntenna)
* \param[out] pplFreqTable - address of variable that receives pointer to array, containing frequencies
- * \param[out] pnLen length of array
+ * \param[out] pnLen length of array
* \param[out] pnFirst - channel number of first entry in array (nChannelMax)
*
* \return S_OK if success
* \return E_POINTER pplFreqTable==NULL || plFirst==NULL || pnLen==NULL
* \return E_FAIL error occured during load
*
- * \remarks
+ * \remarks
* - array must be freed by caller
* - MSDN says that it is not neccessery to unlock or free resource. It will be done after unloading DLL
*/
@@ -942,7 +942,7 @@ static HRESULT load_freq_table(int nCountry, int nInputType,
* \return apropriate error code otherwise
*
* \note
- * Due to either bug in driver or error in following code calll to IKsProperty::Set
+ * Due to either bug in driver or error in following code calll to IKsProperty::Set
* in this methods always fail with error 0x8007007a.
*
* \todo test code on other machines and an error
@@ -1152,9 +1152,9 @@ static HRESULT get_frequency_direct(IAMTVTuner * pTVTuner, long *plFreq)
}
/**
- * \brief gets current frequency
+ * \brief gets current frequency
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
* \param plFreq - pointer to long int to store frequency to (in Hz)
*
* \return TVI_CONTROL_TRUE if success, TVI_CONTROL_FALSE otherwise
@@ -1445,7 +1445,7 @@ static HRESULT build_sub_graph(priv_t * priv, chain_t * chain, const GUID* ppin_
/*
Code below is disabled, because terminating chain with NullRenderer leads to jerky video.
Perhaps, this happens because NullRenderer filter discards each received
- frame while discarded frames causes live source filter to dramatically reduce frame rate.
+ frame while discarded frames causes live source filter to dramatically reduce frame rate.
*/
/* adding sink for video stream */
hr = CoCreateInstance((GUID *) & CLSID_NullRenderer, NULL,CLSCTX_INPROC_SERVER, &IID_IBaseFilter,(void *) &pNR);
@@ -1778,10 +1778,10 @@ static int check_audio_format(AM_MEDIA_TYPE * pmt, int samplerate,
* \return 1 if AM_MEDIA_TYPE compatible
& \return 0 if not
*
- * \note
+ * \note
* width and height are currently not used
*
- * \todo
+ * \todo
* add width/height check
*/
static int check_video_format(AM_MEDIA_TYPE * pmt, int fcc, int width,
@@ -1869,7 +1869,7 @@ static HRESULT show_filter_info(IBaseFilter * pFilter)
* \brief gets device's frendly in ANSI encoding
*
* \param pM IMoniker interface, got in enumeration process
- * \param category device category
+ * \param category device category
*
* \return TVI_CONTROL_TRUE if operation succeded, TVI_CONTROL_FALSE - otherwise
*/
@@ -1902,10 +1902,10 @@ static int get_device_name(IMoniker * pM, char *pBuf, int nLen)
* \brief find capture device at given index
*
* \param index device index to search for (-1 mean only print available)
- * \param category device category
+ * \param category device category
*
* \return IBaseFilter interface for capture device with given index
- *
+ *
* Sample values for category:
* CLSID_VideoInputDeviceCategory - Video Capture Sources
* CLSID_AudioInputDeviceCategory - Audio Capture Sources
@@ -2063,8 +2063,8 @@ static HRESULT get_available_formats_stream(chain_t *chain)
}
/**
- * \brief returns allocates an array and store available media formats for given pin type to it
- *
+ * \brief returns allocates an array and store available media formats for given pin type to it
+ *
* \param pBuilder ICaptureGraphBuilder2 interface of graph builder
* \param chain chain data structure
*
@@ -2198,7 +2198,7 @@ static HRESULT get_available_formats_pin(ICaptureGraphBuilder2 * pBuilder,
/**
* \brief fills given buffer with audio data (usually one block)
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
* \param buffer buffer to store data to
* \param len buffer's size in bytes (usually one block size)
*
@@ -2251,14 +2251,14 @@ static double grab_audio_frame(priv_t * priv, char *buffer, int len)
/**
* \brief returns audio frame size
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
*
* \return audio block size if audio enabled and 1 - otherwise
*/
static int get_audio_framesize(priv_t * priv)
{
if (!priv->chains[1]->rbuf)
- return 1; //no audio
+ return 1; //no audio
mp_msg(MSGT_TV,MSGL_DBG3,"get_audio_framesize: %d\n",priv->chains[1]->rbuf->blocksize);
return priv->chains[1]->rbuf->blocksize;
}
@@ -2281,7 +2281,7 @@ static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp)
//END STUBS!!!
ptsp->bufsize = ptsp->samples_per_line * (ptsp->count[0] + ptsp->count[1]);
- mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
+ mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
ptsp->sampling_rate,
ptsp->offset,
ptsp->samples_per_line,
@@ -2314,7 +2314,7 @@ static void vbi_grabber(priv_t* priv)
/**
* \brief fills given buffer with video data (usually one frame)
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
* \param buffer buffer to store data to
* \param len buffer's size in bytes (usually one frame size)
*
@@ -2363,16 +2363,16 @@ static double grab_video_frame(priv_t * priv, char *buffer, int len)
/**
* \brief returns frame size
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
*
* \return frame size if video present, 0 - otherwise
*/
static int get_video_framesize(priv_t * priv)
{
-// if(!priv->pmtVideo) return 1; //no video
+// if(!priv->pmtVideo) return 1; //no video
// return priv->pmtVideo->lSampleSize;
if (!priv->chains[0]->rbuf)
- return 1; //no video
+ return 1; //no video
mp_msg(MSGT_TV,MSGL_DBG3,"geT_video_framesize: %d\n",priv->chains[0]->rbuf->blocksize);
return priv->chains[0]->rbuf->blocksize;
}
@@ -2430,8 +2430,8 @@ static HRESULT init_chain_common(ICaptureGraphBuilder2 *pBuilder, chain_t *chain
if (FAILED(hr))
chain->pStreamConfig = NULL;
- /*
- Getting available video formats (last pointer in array will be NULL)
+ /*
+ Getting available video formats (last pointer in array will be NULL)
First tryin to call IAMStreamConfig::GetStreamCaos. this will give us additional information such as
min/max picture dimensions, etc. If this call fails trying IPIn::EnumMediaTypes with default
min/max values.
@@ -2572,12 +2572,12 @@ static HRESULT build_vbi_chain(priv_t *priv)
/**
* \brief playback/capture real start
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
*
* \return 1 if success, 0 - otherwise
*
* TODO: move some code from init() here
- */
+ */
static int start(priv_t * priv)
{
HRESULT hr;
@@ -2620,7 +2620,7 @@ static int start(priv_t * priv)
/**
* \brief driver initialization
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
*
* \return 1 if success, 0 - otherwise
*/
@@ -2671,13 +2671,13 @@ static int init(priv_t * priv)
mp_msg(MSGT_TV,MSGL_DBG2, "tvi_dshow: CoCreateInstance(CaptureGraphBuilder) call failed. Error:0x%x\n", (unsigned int)hr);
break;
}
-
+
hr = OLE_CALL_ARGS(priv->pBuilder, SetFiltergraph, priv->pGraph);
if(FAILED(hr)){
mp_msg(MSGT_TV,MSGL_ERR, "tvi_dshow: SetFiltergraph call failed. Error:0x%x\n",(unsigned int)hr);
break;
}
-
+
mp_msg(MSGT_TV, MSGL_DBG2, "tvi_dshow: Searching for available video capture devices\n");
priv->chains[0]->pCaptureFilter = find_capture_device(priv->dev_index, &CLSID_VideoInputDeviceCategory);
if(!priv->chains[0]->pCaptureFilter){
@@ -2961,7 +2961,7 @@ static void destroy_chain(chain_t *chain)
/**
* \brief driver uninitialization
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
*
* \return always 1
*/
@@ -3071,11 +3071,11 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
/**
* \brief driver's ioctl handler
*
- * \param priv driver's private data structure
+ * \param priv driver's private data structure
* \param cmd ioctl command
* \param arg ioct command's parameter
*
- * \return TVI_CONTROL_TRUE if success
+ * \return TVI_CONTROL_TRUE if success
* \return TVI_CONTROL_FALSE if failure
* \return TVI_CONTROL_UNKNOWN if unknowm cmd called
*/
@@ -3318,7 +3318,7 @@ static int control(priv_t * priv, int cmd, void *arg)
if (check_audio_format
(priv->chains[1]->arpmt[i], samplerate, 16, priv->channels))
break;
- if (!priv->chains[1]->arpmt[i]) {
+ if (!priv->chains[1]->arpmt[i]) {
//request not found. failing back to first available
mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TVI_DS_SamplerateNotsupported, samplerate);
i = 0;
@@ -3372,7 +3372,7 @@ static int control(priv_t * priv, int cmd, void *arg)
lAnalogFormat = tv_norms[tv_available_norms[i]].index;
hr = OLE_QUERYINTERFACE(priv->chains[0]->pCaptureFilter,IID_IAMAnalogVideoDecoder, pVD);
- if (hr != S_OK)
+ if (hr != S_OK)
return TVI_CONTROL_FALSE;
hr = OLE_CALL_ARGS(pVD, put_TVFormat, lAnalogFormat);
OLE_RELEASE_SAFE(pVD);
diff --git a/stream/tvi_dshow.h b/stream/tvi_dshow.h
index 784bcfb0c2..dc5a7c3741 100644
--- a/stream/tvi_dshow.h
+++ b/stream/tvi_dshow.h
@@ -29,7 +29,7 @@ typedef struct IReferenceClock *LPREFERENCECLOCK;
typedef struct IMediaSample *LPMEDIASAMPLE;
typedef struct IVideoWindow *LPVIDEOWINDOW;
-typedef struct
+typedef struct
{
long cBuffers;
long cbBuffer;
@@ -613,7 +613,7 @@ DECLARE_INTERFACE(IMediaSample)
STDMETHOD(SetMediaTime )(THIS_ long long* ,long long* );
};
-
+
#undef INTERFACE
#define INTERFACE IAMBufferNegotiation
DECLARE_INTERFACE(IAMBufferNegotiation)
diff --git a/stream/tvi_v4l.c b/stream/tvi_v4l.c
index 8979691776..ea7064762c 100644
--- a/stream/tvi_v4l.c
+++ b/stream/tvi_v4l.c
@@ -797,7 +797,7 @@ static int vbi_init(priv_t* priv,char* device)
mp_msg(MSGT_TV,MSGL_ERR,"vbi: could not open device %s\n",priv->vbi_dev);
return TVI_CONTROL_FALSE;
}
-
+
if(ioctl(vbi_fd,VIDIOCGCAP,&cap)<0){
mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query capatibilities failed for %s\n",priv->vbi_dev);
close(vbi_fd);
@@ -845,7 +845,7 @@ static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp)
ptsp->count[1]=fmt.count[1];
ptsp->bufsize = ptsp->samples_per_line * (ptsp->count[0] + ptsp->count[1]);
- mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
+ mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
ptsp->sampling_rate,
ptsp->offset,
ptsp->samples_per_line,
@@ -1541,7 +1541,7 @@ static int set_mute(priv_t* priv,int value)
{
if (!priv->capability.audios) {
return 0;
-
+
if(value)
priv->audio[priv->audio_id].flags |=VIDEO_AUDIO_MUTE;
else
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 5bd654282e..786d42529e 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -80,7 +80,7 @@ struct map {
typedef struct {
unsigned char *data; ///< frame contents
long long timestamp; ///< frame timestamp
- int framesize; ///< actual frame size
+ int framesize; ///< actual frame size
} video_buffer_entry;
/* private data */
@@ -330,7 +330,7 @@ static int pixfmt2depth(int pixfmt)
return 0;
}
-static int amode2v4l(int amode)
+static int amode2v4l(int amode)
{
switch (amode) {
case 0:
@@ -492,7 +492,7 @@ static int getstd(priv_t *priv)
* *
\***********************************************************************/
-static int set_mute(priv_t *priv, int value)
+static int set_mute(priv_t *priv, int value)
{
struct v4l2_control control;
control.id = V4L2_CID_AUDIO_MUTE;
@@ -535,7 +535,7 @@ static int set_control(priv_t *priv, struct v4l2_control *control, int val_signe
(qctrl.maximum - qctrl.default_value) / 50;
}
}
-
+
if (ioctl(priv->video_fd, VIDIOC_S_CTRL, control) < 0) {
mp_msg(MSGT_TV, MSGL_ERR,"%s: ioctl set %s %d failed: %s\n",
@@ -609,7 +609,7 @@ static int vbi_init(priv_t* priv,char* device)
mp_msg(MSGT_TV,MSGL_ERR,"vbi: could not open device %s\n",priv->vbi_dev);
return TVI_CONTROL_FALSE;
}
-
+
if(ioctl(vbi_fd,VIDIOC_QUERYCAP,&cap)<0){
mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query capatibilities failed for %s\n",priv->vbi_dev);
close(vbi_fd);
@@ -662,7 +662,7 @@ static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp)
ptsp->count[1]=fmt.fmt.vbi.count[1];
ptsp->bufsize = ptsp->samples_per_line * (ptsp->count[0] + ptsp->count[1]);
- mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
+ mp_msg(MSGT_TV,MSGL_V,"vbi_get_props: sampling_rate=%d,offset:%d,samples_per_line: %d\n interlaced:%s, count=[%d,%d]\n",
ptsp->sampling_rate,
ptsp->offset,
ptsp->samples_per_line,
@@ -694,7 +694,7 @@ static void *vbi_grabber(void *data)
mp_msg(MSGT_TV,MSGL_V,"vbi: vbi capture thread started.\n");
while (!priv->vbi_shutdown){
- bytes=read(priv->vbi_fd,buf,tsp.bufsize);
+ bytes=read(priv->vbi_fd,buf,tsp.bufsize);
if(bytes<0 && errno==EINTR)
continue;
if (bytes!=tsp.bufsize){
@@ -759,7 +759,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if (getfmt(priv) < 0) return TVI_CONTROL_FALSE;
priv->format.fmt.pix.pixelformat = fcc_mp2vl(*(int *)arg);
priv->format.fmt.pix.field = V4L2_FIELD_ANY;
-
+
priv->mp_format = *(int *)arg;
mp_msg(MSGT_TV, MSGL_V, "%s: set format: %s\n", info.short_name,
pixfmt2name(priv->format.fmt.pix.pixelformat));
@@ -1122,7 +1122,7 @@ static int uninit(priv_t *priv)
free(priv->vbi_dev);
priv->vbi_dev=0;
}
-
+
#endif
priv->shutdown = 1;
@@ -1398,7 +1398,7 @@ static int get_capture_buffer_size(priv_t *priv)
} else {
#ifdef HAVE_SYS_SYSINFO_H
struct sysinfo si;
-
+
sysinfo(&si);
if (si.totalram<2*1024*1024) {
bufsize = 1024*1024;
@@ -1409,10 +1409,10 @@ static int get_capture_buffer_size(priv_t *priv)
bufsize = 16*1024*1024;
#endif
}
-
+
cnt = bufsize/priv->format.fmt.pix.sizeimage;
if (cnt < 2) cnt = 2;
-
+
return cnt;
}
@@ -1433,7 +1433,7 @@ static int start(priv_t *priv)
} else {
priv->video_buffer_size_max = get_capture_buffer_size(priv);
}
-
+
if (!priv->tv_param->noaudio) {
setup_audio_buffer_sizes(priv);
priv->audio_skew_buffer = calloc(priv->aud_skew_cnt, sizeof(long long));
@@ -1484,10 +1484,10 @@ static int start(priv_t *priv)
"You will probably experience heavy framedrops.\n");
}
}
-
+
{
int bytesperline = priv->format.fmt.pix.width*pixfmt2depth(priv->format.fmt.pix.pixelformat)/8;
-
+
mp_msg(MSGT_TV, MSGL_V, "Using a ring buffer for maximum %d frames, %d MB total size.\n",
priv->video_buffer_size_max,
priv->video_buffer_size_max*priv->format.fmt.pix.height*bytesperline/(1024*1024));
@@ -1505,14 +1505,14 @@ static int start(priv_t *priv)
priv->video_head = 0;
priv->video_tail = 0;
priv->video_cnt = 0;
-
+
/* request buffers */
if (priv->immediate_mode) {
request.count = 2;
} else {
request.count = BUFFER_COUNT;
}
-
+
request.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
request.memory = V4L2_MEMORY_MMAP;
if (ioctl(priv->video_fd, VIDIOC_REQBUFS, &request) < 0) {
@@ -1575,7 +1575,7 @@ static int start(priv_t *priv)
priv->first = 1;
set_mute(priv, 0);
-
+
return 1;
}
@@ -1629,7 +1629,7 @@ static void *video_grabber(void *data)
for (priv->frames = 0; !priv->shutdown;)
{
int ret;
-
+
if (priv->immediate_mode) {
while (priv->video_cnt == priv->video_buffer_size_max) {
usleep(10000);
@@ -1638,7 +1638,7 @@ static void *video_grabber(void *data)
}
}
}
-
+
FD_ZERO (&rdset);
FD_SET (priv->video_fd, &rdset);
@@ -1691,7 +1691,7 @@ static void *video_grabber(void *data)
mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl queue buffer failed: %s\n",
info.short_name, strerror(errno));
return 0;
- }
+ }
}
}
continue;
@@ -1767,7 +1767,7 @@ static void *video_grabber(void *data)
priv->video_ringbuffer[priv->video_tail].timestamp = interval - skew;
if (priv->audio_insert_null_samples && priv->video_ringbuffer[priv->video_tail].timestamp > 0) {
pthread_mutex_lock(&priv->audio_mutex);
- priv->video_ringbuffer[priv->video_tail].timestamp +=
+ priv->video_ringbuffer[priv->video_tail].timestamp +=
(priv->audio_null_blocks_inserted
- priv->dropped_frames_timeshift/priv->audio_usecs_per_block)
*priv->audio_usecs_per_block;
@@ -1815,8 +1815,8 @@ static double grab_video_frame(priv_t *priv, char *buffer, int len)
static int get_video_framesize(priv_t *priv)
{
- /*
- this routine will be called before grab_video_frame
+ /*
+ this routine will be called before grab_video_frame
thus let's return topmost frame's size
*/
if (priv->video_cnt)
@@ -1838,7 +1838,7 @@ static void read_doublespeed(priv_t *priv)
short *s;
short *d;
int i;
-
+
audio_in_read_chunk(&priv->audio_in, bufx);
audio_in_read_chunk(&priv->audio_in, bufx+priv->audio_in.blocksize);
@@ -1848,7 +1848,7 @@ static void read_doublespeed(priv_t *priv)
*d++ = *s++;
*s++;
}
-
+
}
#endif
@@ -1930,7 +1930,7 @@ static void *audio_grabber(void *data)
priv->audio_skew += priv->audio_skew_delta_total/2;
// now finally, priv->audio_skew contains fairly good approximation
- // of the current value
+ // of the current value
// current skew factor (assuming linearity)
// used for further interpolation in video_grabber
@@ -1948,7 +1948,7 @@ static void *audio_grabber(void *data)
prev_skew = priv->audio_skew;
priv->audio_skew += priv->audio_start_time - priv->first_frame;
pthread_mutex_unlock(&priv->skew_mutex);
-
+
// fprintf(stderr, "audio_skew = %lf, delta = %lf\n", (double)priv->audio_skew/1e6, (double)priv->audio_skew_delta_total/1e6);
pthread_mutex_lock(&priv->audio_mutex);
diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c
index c060f43ef2..58d830e1d2 100644
--- a/stream/tvi_vbi.c
+++ b/stream/tvi_vbi.c
@@ -331,11 +331,11 @@ static const unsigned int latin_subchars[8][13]={
* List of supported languages.
*
* lang_code bits for primary Language:
- * bits 7-4 corresponds to bits 14-11 of 28 packet's first triplet
+ * bits 7-4 corresponds to bits 14-11 of 28 packet's first triplet
* bits 3-1 corresponds to bits C12-C14 of packet 0 (lang)
*
* lang_code bits for secondary Language:
- * bits 7-5 corresponds to bits 3-1 of 28 packet's second triplet
+ * bits 7-5 corresponds to bits 3-1 of 28 packet's second triplet
* bits 4,2 corresponds to bits 18,16 of 28 packet's first triplet
* bits 3,1 corresponds to bits 15,17 of 28 packet's first triplet
*
@@ -370,7 +370,7 @@ struct {
{ 0x16, LATIN, "Italian"},
{ 0x1d, LATIN, "Serbian/Croatian/Slovenian (Latin)"},
-
+
{ 0x20, CYRILLIC1, "Serbian/Croatian (Cyrillic)"},
{ 0x21, CYRILLIC2, "Russian, Bulgarian"},
{ 0x22, LATIN, "Estonian"},
@@ -409,7 +409,7 @@ static int corrHamm24(unsigned char *data){
syndrom^=((cw>>i)&1)*(i+33);
syndrom^=(cw>>11)&32;
-
+
if(syndrom&31){
if(syndrom < 32 || syndrom > 55)
return -1;
@@ -508,7 +508,7 @@ static void init_vbi_consts(priv_vbi_t* priv){
*
*
* Page numbers 0xYYY (where Y is not belongs to (0..9).
- * Page number belongs to [0x000,0x799] or [0x100:0x899] (first 0 can be
+ * Page number belongs to [0x000,0x799] or [0x100:0x899] (first 0 can be
* treated as '8')
*/
static int steppage(int p, int direction, int skip_hidden)
@@ -628,7 +628,7 @@ static inline tt_page* get_from_cache(priv_vbi_t* priv, int pagenum,int subpagen
static void clear_cache(priv_vbi_t* priv){
int i;
tt_page* tp;
-
+
/*
Skip next 5 buffers to avoid mixing teletext pages from different
channels during channel switch
@@ -724,7 +724,7 @@ static void decode_page(tt_char* p,unsigned char* raw,int primary_lang,int secon
p[i].fg=fg_color;
p[i].bg=bg_color;
p[i].flh=flash;
-
+
if ((c&0x60)==0){ //control chars
if(c>=0x08 && c<=0x09){//Flash/Steady
flash=c==0x08;
@@ -860,7 +860,7 @@ static void prepare_visible_page(priv_vbi_t* priv){
priv->display_page[10].unicode=' ';
}
priv->display_page[11].unicode=' ';
- for(i=VBI_COLUMNS;i>VBI_TIME_LINEPOS ||
+ for(i=VBI_COLUMNS;i>VBI_TIME_LINEPOS ||
((curr_pg->raw[i]&0x60) && curr_pg->raw[i]!=0x20 && i>11);
--i)
if(curr_pg->raw[i]&0x60)
@@ -1247,7 +1247,7 @@ static int decode_pkt27(priv_vbi_t* priv,unsigned char* data,int magAddr){
return 0;
}
- /*
+ /*
Not a X/27/0 Format 1 packet or
flag "show links on row 24" is not set.
*/
@@ -1294,7 +1294,7 @@ static void decode_pkt28(priv_vbi_t* priv,unsigned char*data){
priv->primary_language=(t1>>7)&0x7f;
priv->secondary_language=((t2<<4) | (t1>>14))&0x7f;
- if (priv->secondary_language==0x7f)
+ if (priv->secondary_language==0x7f)
//No secondary language required
priv->secondary_language=priv->primary_language;
else // Swapping bits 1 and 3
diff --git a/stream/udp.c b/stream/udp.c
index 612d73708e..e27808b4c2 100644
--- a/stream/udp.c
+++ b/stream/udp.c
@@ -120,7 +120,7 @@ udp_open_socket (URL_t *url)
return -1;
}
}
-
+
#if HAVE_WINSOCK2_H
if (isalpha (url->hostname[0]))
{
@@ -170,7 +170,7 @@ udp_open_socket (URL_t *url)
FD_ZERO (&set);
FD_SET (socket_server_fd, &set);
-
+
err = select (socket_server_fd + 1, &set, NULL, NULL, &tv);
if (err < 0)
{
diff --git a/stream/url.c b/stream/url.c
index 89d4eaaa7b..92e872e599 100644
--- a/stream/url.c
+++ b/stream/url.c
@@ -52,7 +52,7 @@ url_new(const char* url) {
int jumpSize = 3;
if( url==NULL ) return NULL;
-
+
if (strlen(url) > (SIZE_MAX / 3 - 1)) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
goto err_out;
@@ -158,7 +158,7 @@ url_new(const char* url) {
ptr2 = ptr1;
}
-
+
// look if the port is given
ptr2 = strstr(ptr2, ":");
// If the : is after the first / it isn't the port
@@ -204,7 +204,7 @@ url_new(const char* url) {
goto err_out;
}
}
- }
+ }
// Check if a filename was given or set, else set it with '/'
if( Curl->file==NULL ) {
Curl->file = malloc(2);
@@ -214,7 +214,7 @@ url_new(const char* url) {
}
strcpy(Curl->file, "/");
}
-
+
free(escfilename);
return Curl;
err_out:
@@ -259,7 +259,7 @@ url_unescape_string(char *outbuf, const char *inbuf)
}
}
*outbuf++ = c;
- }
+ }
*outbuf++='\0'; //add nullterm to string
}
@@ -285,7 +285,7 @@ url_escape_string_part(char *outbuf, const char *inbuf) {
((c2 >= '0' && c2 <= '9') || (c2 >= 'A' && c2 <= 'F'))) {
// check if part of an escape sequence
*outbuf++=c; // already
-
+
// dont escape again
mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_URL_StringAlreadyEscaped,c,c1,c2);
// error as this should not happen against RFC 2396
@@ -313,7 +313,7 @@ url_escape_string(char *outbuf, const char *inbuf) {
unsigned char c;
int i = 0,j,len = strlen(inbuf);
char* tmp,*unesc = NULL, *in;
-
+
// Look if we have an ip6 address, if so skip it there is
// no need to escape anything in there.
tmp = strstr(inbuf,"://[");
@@ -327,7 +327,7 @@ url_escape_string(char *outbuf, const char *inbuf) {
tmp = NULL;
}
}
-
+
tmp = NULL;
while(i < len) {
// look for the next char that must be kept
@@ -353,7 +353,7 @@ url_escape_string(char *outbuf, const char *inbuf) {
in = tmp;
} else // take the rest of the string
in = (char*)inbuf+i;
-
+
if(!unesc) unesc = malloc(len+1);
// unescape first to avoid escaping escape
url_unescape_string(unesc,in);
diff --git a/stream/url.h b/stream/url.h
index 1f13bee1d7..be39fddde2 100644
--- a/stream/url.h
+++ b/stream/url.h
@@ -1,4 +1,4 @@
-/*
+/*
* URL Helper
* by Bertrand Baudet <bertrand_baudet@yahoo.com>
* (C) 2001, MPlayer team.
diff --git a/stream/vcd_read.h b/stream/vcd_read.h
index 177316ecae..b31abc0401 100644
--- a/stream/vcd_read.h
+++ b/stream/vcd_read.h
@@ -84,7 +84,7 @@ mp_vcd_priv_t* vcd_read_toc(int fd){
mp_msg(MSGT_OPEN,MSGL_ERR,"read CDROM toc entry: %s\n",strerror(errno));
return NULL;
}
-
+
if (i<=tochdr.cdth_trk1)
mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d mode: %d\n",
(int)tocentry.cdte_track,
@@ -149,7 +149,7 @@ static int vcd_read(mp_vcd_priv_t* vcd,char *mem){
vcd->entry.cdte_addr.msf.minute++;
}
}
-
+
return VCD_SECTOR_DATA;
}
@@ -171,7 +171,7 @@ static int sun_vcd_read(mp_vcd_priv_t* vcd, int *offset)
cdxa.cdxa_length = 1;
cdxa.cdxa_data = vcd->buf;
cdxa.cdxa_format = CDROM_XA_SECTOR_DATA;
-
+
if(ioctl(vcd->fd,CDROMCDXA,&cdxa)==-1) {
mp_msg(MSGT_STREAM,MSGL_ERR,"CDROMCDXA: %s\n",strerror(errno));
return 0;
diff --git a/stream/vcd_read_darwin.h b/stream/vcd_read_darwin.h
index 4d92458486..d144b5bc69 100644
--- a/stream/vcd_read_darwin.h
+++ b/stream/vcd_read_darwin.h
@@ -56,7 +56,7 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
vcd->entry.address = track;
vcd->entry.bufferLength = sizeof(entry);
vcd->entry.buffer = &entry;
-
+
if (ioctl(vcd->fd, DKIOCCDREADTRACKINFO, &vcd->entry))
{
mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif1: %s\n",strerror(errno));
@@ -69,21 +69,21 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
int vcd_get_track_end(mp_vcd_priv_t* vcd, int track)
{
struct CDTrackInfo entry;
-
+
if (track > vcd->hdr.lastTrackNumberInLastSessionLSB) {
mp_msg(MSGT_OPEN, MSGL_ERR,
"track number %d greater than last track number %d\n",
track, vcd->hdr.lastTrackNumberInLastSessionLSB);
return -1;
}
-
+
//read track info
memset( &vcd->entry, 0, sizeof(vcd->entry));
vcd->entry.addressType = kCDTrackInfoAddressTypeTrackNumber;
vcd->entry.address = track<vcd->hdr.lastTrackNumberInLastSessionLSB?track+1:vcd->hdr.lastTrackNumberInLastSessionLSB;
vcd->entry.bufferLength = sizeof(entry);
vcd->entry.buffer = &entry;
-
+
if (ioctl(vcd->fd, DKIOCCDREADTRACKINFO, &vcd->entry))
{
mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif2: %s\n",strerror(errno));
@@ -101,25 +101,25 @@ mp_vcd_priv_t* vcd_read_toc(int fd)
{
dk_cd_read_disc_info_t tochdr;
struct CDDiscInfo hdr;
-
+
dk_cd_read_track_info_t tocentry;
struct CDTrackInfo entry;
CDMSF trackMSF;
-
+
mp_vcd_priv_t* vcd;
int i, min = 0, sec = 0, frame = 0;
-
+
//read toc header
memset(&tochdr, 0, sizeof(tochdr));
tochdr.buffer = &hdr;
tochdr.bufferLength = sizeof(hdr);
-
+
if (ioctl(fd, DKIOCCDREADDISCINFO, &tochdr) < 0)
{
mp_msg(MSGT_OPEN,MSGL_ERR,"read CDROM toc header: %s\n",strerror(errno));
return NULL;
}
-
+
//print all track info
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VCD_START_TRACK=%d\n", hdr.firstTrackNumberInLastSessionLSB);
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VCD_END_TRACK=%d\n", hdr.lastTrackNumberInLastSessionLSB);
@@ -137,13 +137,13 @@ mp_vcd_priv_t* vcd_read_toc(int fd)
mp_msg(MSGT_OPEN,MSGL_ERR,"read CDROM toc entry: %s\n",strerror(errno));
return NULL;
}
-
+
trackMSF = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
}
else
trackMSF = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress)
+ be2me_32(entry.trackSize));
-
+
//mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d\n",
if (i<=hdr.lastTrackNumberInLastSessionLSB)
mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d: format=%d %02d:%02d:%02d\n",
@@ -180,7 +180,7 @@ mp_vcd_priv_t* vcd_read_toc(int fd)
frame = trackMSF.frame;
}
}
-
+
vcd = malloc(sizeof(mp_vcd_priv_t));
vcd->fd = fd;
vcd->hdr = hdr;
@@ -198,14 +198,14 @@ static int vcd_read(mp_vcd_priv_t* vcd,char *mem)
{
vcd->msf.frame=0;
vcd->msf.second++;
-
+
if (vcd->msf.second==60)
{
vcd->msf.second=0;
vcd->msf.minute++;
}
}
-
+
memcpy(mem,vcd->buf.data,VCD_SECTOR_DATA);
return VCD_SECTOR_DATA;
}