aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2014-04-13 18:00:51 +0200
committerGravatar wm4 <wm4@nowhere>2014-04-13 18:03:01 +0200
commit78128bddda4bcea1f256fc13cc33fa2652ed277c (patch)
tree35bf6596cb8e2d7927618845833c3ee36534f890 /stream
parent44f382cf98564c0fe08bdc78579c284362cd6f3c (diff)
Kill all tabs
I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
Diffstat (limited to 'stream')
-rw-r--r--stream/ai_alsa1x.c104
-rw-r--r--stream/ai_oss.c82
-rw-r--r--stream/ai_sndio.c10
-rw-r--r--stream/audio_in.c198
-rw-r--r--stream/cookies.c62
-rw-r--r--stream/dvb_tune.c368
-rw-r--r--stream/dvbin.h76
-rw-r--r--stream/frequencies.c1416
-rw-r--r--stream/frequencies.h108
-rw-r--r--stream/stream_dvb.c1200
-rw-r--r--stream/stream_dvd.c8
-rw-r--r--stream/stream_radio.c2
-rw-r--r--stream/stream_smb.c2
-rw-r--r--stream/stream_vcd.c2
-rw-r--r--stream/tv.c610
-rw-r--r--stream/tv.h136
-rw-r--r--stream/tvi_def.h10
-rw-r--r--stream/tvi_dummy.c70
-rw-r--r--stream/tvi_v4l2.c10
-rw-r--r--stream/vcd_read.h14
-rw-r--r--stream/vcd_read_darwin.h216
-rw-r--r--stream/vcd_read_fbsd.h12
-rw-r--r--stream/vcd_read_win32.h48
23 files changed, 2382 insertions, 2382 deletions
diff --git a/stream/ai_alsa1x.c b/stream/ai_alsa1x.c
index c1a7199c71..bf36443dfe 100644
--- a/stream/ai_alsa1x.c
+++ b/stream/ai_alsa1x.c
@@ -40,61 +40,61 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_hw_params_any(ai->alsa.handle, params);
if (err < 0) {
- MP_ERR(ai, "Broken configuration for this PCM: no configurations available.\n");
- return -1;
+ MP_ERR(ai, "Broken configuration for this PCM: no configurations available.\n");
+ return -1;
}
err = snd_pcm_hw_params_set_access(ai->alsa.handle, params,
- SND_PCM_ACCESS_RW_INTERLEAVED);
+ SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
- MP_ERR(ai, "Access type not available.\n");
- return -1;
+ MP_ERR(ai, "Access type not available.\n");
+ return -1;
}
err = snd_pcm_hw_params_set_format(ai->alsa.handle, params, SND_PCM_FORMAT_S16_LE);
if (err < 0) {
- MP_ERR(ai, "Sample format not available.\n");
- return -1;
+ MP_ERR(ai, "Sample format not available.\n");
+ return -1;
}
err = snd_pcm_hw_params_set_channels(ai->alsa.handle, params, ai->req_channels);
if (err < 0) {
- snd_pcm_hw_params_get_channels(params, &ai->channels);
- MP_ERR(ai, "Channel count not available - reverting to default: %d\n",
- ai->channels);
+ snd_pcm_hw_params_get_channels(params, &ai->channels);
+ MP_ERR(ai, "Channel count not available - reverting to default: %d\n",
+ ai->channels);
} else {
- ai->channels = ai->req_channels;
+ ai->channels = ai->req_channels;
}
dir = 0;
rate = ai->req_samplerate;
err = snd_pcm_hw_params_set_rate_near(ai->alsa.handle, params, &rate, &dir);
if (err < 0) {
- MP_ERR(ai, "Cannot set samplerate.\n");
+ MP_ERR(ai, "Cannot set samplerate.\n");
}
ai->samplerate = rate;
dir = 0;
ai->alsa.buffer_time = 1000000;
err = snd_pcm_hw_params_set_buffer_time_near(ai->alsa.handle, params,
- &ai->alsa.buffer_time, &dir);
+ &ai->alsa.buffer_time, &dir);
if (err < 0) {
- MP_ERR(ai, "Cannot set buffer time.\n");
+ MP_ERR(ai, "Cannot set buffer time.\n");
}
dir = 0;
ai->alsa.period_time = ai->alsa.buffer_time / 4;
err = snd_pcm_hw_params_set_period_time_near(ai->alsa.handle, params,
- &ai->alsa.period_time, &dir);
+ &ai->alsa.period_time, &dir);
if (err < 0) {
- MP_ERR(ai, "Cannot set period time.\n");
+ MP_ERR(ai, "Cannot set period time.\n");
}
err = snd_pcm_hw_params(ai->alsa.handle, params);
if (err < 0) {
- MP_ERR(ai, "Unable to install hardware parameters: %s", snd_strerror(err));
- snd_pcm_hw_params_dump(params, ai->alsa.log);
- return -1;
+ MP_ERR(ai, "Unable to install hardware parameters: %s", snd_strerror(err));
+ snd_pcm_hw_params_dump(params, ai->alsa.log);
+ return -1;
}
dir = -1;
@@ -102,8 +102,8 @@ int ai_alsa_setup(audio_in_t *ai)
snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
ai->alsa.chunk_size = period_size;
if (period_size == buffer_size) {
- MP_ERR(ai, "Can't use period equal to buffer size (%u == %lu)\n", ai->alsa.chunk_size, (long)buffer_size);
- return -1;
+ MP_ERR(ai, "Can't use period equal to buffer size (%u == %lu)\n", ai->alsa.chunk_size, (long)buffer_size);
+ return -1;
}
snd_pcm_sw_params_current(ai->alsa.handle, swparams);
@@ -113,13 +113,13 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_sw_params_set_stop_threshold(ai->alsa.handle, swparams, buffer_size);
if (snd_pcm_sw_params(ai->alsa.handle, swparams) < 0) {
- MP_ERR(ai, "Unable to install software parameters:\n");
- snd_pcm_sw_params_dump(swparams, ai->alsa.log);
- return -1;
+ MP_ERR(ai, "Unable to install software parameters:\n");
+ snd_pcm_sw_params_dump(swparams, ai->alsa.log);
+ return -1;
}
if (mp_msg_test(ai->log, MSGL_V)) {
- snd_pcm_dump(ai->alsa.handle, ai->alsa.log);
+ snd_pcm_dump(ai->alsa.handle, ai->alsa.log);
}
ai->alsa.bits_per_sample = snd_pcm_format_physical_width(SND_PCM_FORMAT_S16_LE);
@@ -137,14 +137,14 @@ int ai_alsa_init(audio_in_t *ai)
err = snd_pcm_open(&ai->alsa.handle, ai->alsa.device, SND_PCM_STREAM_CAPTURE, 0);
if (err < 0) {
- MP_ERR(ai, "Error opening audio: %s\n", snd_strerror(err));
- return -1;
+ MP_ERR(ai, "Error opening audio: %s\n", snd_strerror(err));
+ return -1;
}
err = snd_output_stdio_attach(&ai->alsa.log, stderr, 0);
if (err < 0) {
- return -1;
+ return -1;
}
err = ai_alsa_setup(ai);
@@ -153,14 +153,14 @@ int ai_alsa_init(audio_in_t *ai)
}
#ifndef timersub
-#define timersub(a, b, result) \
+#define timersub(a, b, result) \
do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
} while (0)
#endif
@@ -171,25 +171,25 @@ int ai_alsa_xrun(audio_in_t *ai)
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(ai->alsa.handle, status))<0) {
- MP_ERR(ai, "ALSA status error: %s", snd_strerror(res));
- return -1;
+ MP_ERR(ai, "ALSA status error: %s", snd_strerror(res));
+ return -1;
}
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) {
- struct timeval now, diff, tstamp;
- gettimeofday(&now, 0);
- snd_pcm_status_get_trigger_tstamp(status, &tstamp);
- timersub(&now, &tstamp, &diff);
- MP_ERR(ai, "ALSA xrun!!! (at least %.3f ms long)\n",
- diff.tv_sec * 1000 + diff.tv_usec / 1000.0);
- if (mp_msg_test(ai->log, MSGL_V)) {
- MP_ERR(ai, "ALSA Status:\n");
- snd_pcm_status_dump(status, ai->alsa.log);
- }
- if ((res = snd_pcm_prepare(ai->alsa.handle))<0) {
- MP_ERR(ai, "ALSA xrun: prepare error: %s", snd_strerror(res));
- return -1;
- }
- return 0; /* ok, data should be accepted again */
+ struct timeval now, diff, tstamp;
+ gettimeofday(&now, 0);
+ snd_pcm_status_get_trigger_tstamp(status, &tstamp);
+ timersub(&now, &tstamp, &diff);
+ MP_ERR(ai, "ALSA xrun!!! (at least %.3f ms long)\n",
+ diff.tv_sec * 1000 + diff.tv_usec / 1000.0);
+ if (mp_msg_test(ai->log, MSGL_V)) {
+ MP_ERR(ai, "ALSA Status:\n");
+ snd_pcm_status_dump(status, ai->alsa.log);
+ }
+ if ((res = snd_pcm_prepare(ai->alsa.handle))<0) {
+ MP_ERR(ai, "ALSA xrun: prepare error: %s", snd_strerror(res));
+ return -1;
+ }
+ return 0; /* ok, data should be accepted again */
}
MP_ERR(ai, "ALSA read/write error");
return -1;
diff --git a/stream/ai_oss.c b/stream/ai_oss.c
index 8672d13fc0..b7a7988bde 100644
--- a/stream/ai_oss.c
+++ b/stream/ai_oss.c
@@ -56,28 +56,28 @@ int ai_oss_set_channels(audio_in_t *ai)
if (ai->req_channels > 2)
{
- ioctl_param = ai->req_channels;
- MP_VERBOSE(ai, "ioctl dsp channels: %d\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_CHANNELS, &ioctl_param));
- if (err < 0) {
- MP_ERR(ai, "Unable to set channel count: %d\n",
- ai->req_channels);
- return -1;
- }
- ai->channels = ioctl_param;
+ ioctl_param = ai->req_channels;
+ MP_VERBOSE(ai, "ioctl dsp channels: %d\n",
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_CHANNELS, &ioctl_param));
+ if (err < 0) {
+ MP_ERR(ai, "Unable to set channel count: %d\n",
+ ai->req_channels);
+ return -1;
+ }
+ ai->channels = ioctl_param;
}
else
{
- ioctl_param = (ai->req_channels == 2);
- MP_VERBOSE(ai, "ioctl dsp stereo: %d (req: %d)\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_STEREO, &ioctl_param),
- ioctl_param);
- if (err < 0) {
- MP_ERR(ai, "Unable to set stereo: %d\n",
- ai->req_channels == 2);
- return -1;
- }
- ai->channels = ioctl_param ? 2 : 1;
+ ioctl_param = (ai->req_channels == 2);
+ MP_VERBOSE(ai, "ioctl dsp stereo: %d (req: %d)\n",
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_STEREO, &ioctl_param),
+ ioctl_param);
+ if (err < 0) {
+ MP_ERR(ai, "Unable to set stereo: %d\n",
+ ai->req_channels == 2);
+ return -1;
+ }
+ ai->channels = ioctl_param ? 2 : 1;
}
return 0;
}
@@ -90,65 +90,65 @@ int ai_oss_init(audio_in_t *ai)
ai->oss.audio_fd = open(ai->oss.device, O_RDONLY | O_CLOEXEC);
if (ai->oss.audio_fd < 0)
{
- MP_ERR(ai, "Unable to open '%s': %s\n",
- ai->oss.device, strerror(errno));
- return -1;
+ MP_ERR(ai, "Unable to open '%s': %s\n",
+ ai->oss.device, strerror(errno));
+ return -1;
}
ioctl_param = 0 ;
MP_VERBOSE(ai, "ioctl dsp getfmt: %d\n",
- ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETFMTS, &ioctl_param));
+ ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETFMTS, &ioctl_param));
MP_VERBOSE(ai, "Supported formats: %x\n", ioctl_param);
if (!(ioctl_param & AFMT_S16_LE))
- MP_ERR(ai, "unsupported format\n");
+ MP_ERR(ai, "unsupported format\n");
ioctl_param = AFMT_S16_LE;
MP_VERBOSE(ai, "ioctl dsp setfmt: %d\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETFMT, &ioctl_param));
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETFMT, &ioctl_param));
if (err < 0) {
- MP_ERR(ai, "Unable to set audio format.");
- return -1;
+ MP_ERR(ai, "Unable to set audio format.");
+ return -1;
}
if (ai_oss_set_channels(ai) < 0) return -1;
ioctl_param = ai->req_samplerate;
MP_VERBOSE(ai, "ioctl dsp speed: %d\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SPEED, &ioctl_param));
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SPEED, &ioctl_param));
if (err < 0) {
- MP_ERR(ai, "Unable to set samplerate: %d\n",
- ai->req_samplerate);
- return -1;
+ MP_ERR(ai, "Unable to set samplerate: %d\n",
+ ai->req_samplerate);
+ return -1;
}
ai->samplerate = ioctl_param;
MP_VERBOSE(ai, "ioctl dsp trigger: %d\n",
- ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETTRIGGER, &ioctl_param));
+ ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETTRIGGER, &ioctl_param));
MP_VERBOSE(ai, "trigger: %x\n", ioctl_param);
ioctl_param = PCM_ENABLE_INPUT;
MP_VERBOSE(ai, "ioctl dsp trigger: %d\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETTRIGGER, &ioctl_param));
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETTRIGGER, &ioctl_param));
if (err < 0) {
- MP_ERR(ai, "Unable to set trigger: %d\n",
- PCM_ENABLE_INPUT);
+ MP_ERR(ai, "Unable to set trigger: %d\n",
+ PCM_ENABLE_INPUT);
}
ai->blocksize = 0;
MP_VERBOSE(ai, "ioctl dsp getblocksize: %d\n",
- err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETBLKSIZE, &ai->blocksize));
+ err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETBLKSIZE, &ai->blocksize));
if (err < 0) {
- MP_ERR(ai, "Unable to get block size!\n");
+ MP_ERR(ai, "Unable to get block size!\n");
}
MP_VERBOSE(ai, "blocksize: %d\n", ai->blocksize);
// correct the blocksize to a reasonable value
if (ai->blocksize <= 0) {
- ai->blocksize = 4096*ai->channels*2;
- MP_ERR(ai, "Audio block size is zero, setting to %d!\n", ai->blocksize);
+ ai->blocksize = 4096*ai->channels*2;
+ MP_ERR(ai, "Audio block size is zero, setting to %d!\n", ai->blocksize);
} else if (ai->blocksize < 4096*ai->channels*2) {
- ai->blocksize *= 4096*ai->channels*2/ai->blocksize;
- MP_ERR(ai, "Audio block size too low, setting to %d!\n", ai->blocksize);
+ ai->blocksize *= 4096*ai->channels*2/ai->blocksize;
+ MP_ERR(ai, "Audio block size too low, setting to %d!\n", ai->blocksize);
}
ai->samplesize = 16;
diff --git a/stream/ai_sndio.c b/stream/ai_sndio.c
index 3cd68e5ee1..dc3c66279d 100644
--- a/stream/ai_sndio.c
+++ b/stream/ai_sndio.c
@@ -18,11 +18,11 @@ int ai_sndio_setup(audio_in_t *ai)
par.le = 1;
par.rchan = ai->req_channels;
par.rate = ai->req_samplerate;
- par.appbufsz = ai->req_samplerate; /* 1 sec */
+ par.appbufsz = ai->req_samplerate; /* 1 sec */
if (!sio_setpar(ai->sndio.hdl, &par) || !sio_getpar(ai->sndio.hdl, &par)) {
- MP_ERR(ai, "could not configure sndio audio");
- return -1;
+ MP_ERR(ai, "could not configure sndio audio");
+ return -1;
}
ai->channels = par.rchan;
@@ -39,8 +39,8 @@ int ai_sndio_init(audio_in_t *ai)
int err;
if ((ai->sndio.hdl = sio_open(ai->sndio.device, SIO_REC, 0)) == NULL) {
- MP_ERR(ai, "could not open sndio audio");
- return -1;
+ MP_ERR(ai, "could not open sndio audio");
+ return -1;
}
err = ai_sndio_setup(ai);
diff --git a/stream/audio_in.c b/stream/audio_in.c
index 6592735aa9..8e956630b7 100644
--- a/stream/audio_in.c
+++ b/stream/audio_in.c
@@ -43,25 +43,25 @@ int audio_in_init(audio_in_t *ai, struct mp_log *log, int type)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- ai->alsa.handle = NULL;
- ai->alsa.log = NULL;
- ai->alsa.device = strdup("default");
- return 0;
+ ai->alsa.handle = NULL;
+ ai->alsa.log = NULL;
+ ai->alsa.device = strdup("default");
+ return 0;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- ai->oss.audio_fd = -1;
- ai->oss.device = strdup("/dev/dsp");
- return 0;
+ ai->oss.audio_fd = -1;
+ ai->oss.device = strdup("/dev/dsp");
+ return 0;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
- ai->sndio.hdl = NULL;
- ai->sndio.device = strdup("default");
- return 0;
+ ai->sndio.hdl = NULL;
+ ai->sndio.device = strdup("default");
+ return 0;
#endif
default:
- return -1;
+ return -1;
}
}
@@ -71,24 +71,24 @@ int audio_in_setup(audio_in_t *ai)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- if (ai_alsa_init(ai) < 0) return -1;
- ai->setup = 1;
- return 0;
+ if (ai_alsa_init(ai) < 0) return -1;
+ ai->setup = 1;
+ return 0;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- if (ai_oss_init(ai) < 0) return -1;
- ai->setup = 1;
- return 0;
+ if (ai_oss_init(ai) < 0) return -1;
+ ai->setup = 1;
+ return 0;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
- if (ai_sndio_init(ai) < 0) return -1;
- ai->setup = 1;
- return 0;
+ if (ai_sndio_init(ai) < 0) return -1;
+ ai->setup = 1;
+ return 0;
#endif
default:
- return -1;
+ return -1;
}
}
@@ -97,27 +97,27 @@ int audio_in_set_samplerate(audio_in_t *ai, int rate)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- ai->req_samplerate = rate;
- if (!ai->setup) return 0;
- if (ai_alsa_setup(ai) < 0) return -1;
- return ai->samplerate;
+ ai->req_samplerate = rate;
+ if (!ai->setup) return 0;
+ if (ai_alsa_setup(ai) < 0) return -1;
+ return ai->samplerate;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- ai->req_samplerate = rate;
- if (!ai->setup) return 0;
- if (ai_oss_set_samplerate(ai) < 0) return -1;
- return ai->samplerate;
+ ai->req_samplerate = rate;
+ if (!ai->setup) return 0;
+ if (ai_oss_set_samplerate(ai) < 0) return -1;
+ return ai->samplerate;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
- ai->req_samplerate = rate;
- if (!ai->setup) return 0;
- if (ai_sndio_setup(ai) < 0) return -1;
- return ai->samplerate;
+ ai->req_samplerate = rate;
+ if (!ai->setup) return 0;
+ if (ai_sndio_setup(ai) < 0) return -1;
+ return ai->samplerate;
#endif
default:
- return -1;
+ return -1;
}
}
@@ -126,17 +126,17 @@ int audio_in_set_channels(audio_in_t *ai, int channels)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- ai->req_channels = channels;
- if (!ai->setup) return 0;
- if (ai_alsa_setup(ai) < 0) return -1;
- return ai->channels;
+ ai->req_channels = channels;
+ if (!ai->setup) return 0;
+ if (ai_alsa_setup(ai) < 0) return -1;
+ return ai->channels;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- ai->req_channels = channels;
- if (!ai->setup) return 0;
- if (ai_oss_set_channels(ai) < 0) return -1;
- return ai->channels;
+ ai->req_channels = channels;
+ if (!ai->setup) return 0;
+ if (ai_oss_set_channels(ai) < 0) return -1;
+ return ai->channels;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
@@ -146,7 +146,7 @@ int audio_in_set_channels(audio_in_t *ai, int channels)
return ai->channels;
#endif
default:
- return -1;
+ return -1;
}
}
@@ -159,19 +159,19 @@ int audio_in_set_device(audio_in_t *ai, char *device)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- free(ai->alsa.device);
- ai->alsa.device = strdup(device);
- /* mplayer cannot handle colons in arguments */
- for (i = 0; i < (int)strlen(ai->alsa.device); i++) {
- if (ai->alsa.device[i] == '.') ai->alsa.device[i] = ':';
- }
- return 0;
+ free(ai->alsa.device);
+ ai->alsa.device = strdup(device);
+ /* mplayer cannot handle colons in arguments */
+ for (i = 0; i < (int)strlen(ai->alsa.device); i++) {
+ if (ai->alsa.device[i] == '.') ai->alsa.device[i] = ':';
+ }
+ return 0;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- free(ai->oss.device);
- ai->oss.device = strdup(device);
- return 0;
+ free(ai->oss.device);
+ ai->oss.device = strdup(device);
+ return 0;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
@@ -180,29 +180,29 @@ int audio_in_set_device(audio_in_t *ai, char *device)
return 0;
#endif
default:
- return -1;
+ return -1;
}
}
int audio_in_uninit(audio_in_t *ai)
{
if (ai->setup) {
- switch (ai->type) {
+ switch (ai->type) {
#if HAVE_ALSA
- case AUDIO_IN_ALSA:
- if (ai->alsa.log)
- snd_output_close(ai->alsa.log);
- if (ai->alsa.handle) {
- snd_pcm_close(ai->alsa.handle);
- }
- ai->setup = 0;
- return 0;
+ case AUDIO_IN_ALSA:
+ if (ai->alsa.log)
+ snd_output_close(ai->alsa.log);
+ if (ai->alsa.handle) {
+ snd_pcm_close(ai->alsa.handle);
+ }
+ ai->setup = 0;
+ return 0;
#endif
#if HAVE_OSS_AUDIO
- case AUDIO_IN_OSS:
- close(ai->oss.audio_fd);
- ai->setup = 0;
- return 0;
+ case AUDIO_IN_OSS:
+ close(ai->oss.audio_fd);
+ ai->setup = 0;
+ return 0;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
@@ -211,7 +211,7 @@ int audio_in_uninit(audio_in_t *ai)
ai->setup = 0;
return 0;
#endif
- }
+ }
}
return -1;
}
@@ -221,11 +221,11 @@ int audio_in_start_capture(audio_in_t *ai)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- return snd_pcm_start(ai->alsa.handle);
+ return snd_pcm_start(ai->alsa.handle);
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- return 0;
+ return 0;
#endif
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
@@ -234,7 +234,7 @@ int audio_in_start_capture(audio_in_t *ai)
return 0;
#endif
default:
- return -1;
+ return -1;
}
}
@@ -245,27 +245,27 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
switch (ai->type) {
#if HAVE_ALSA
case AUDIO_IN_ALSA:
- ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
- if (ret != ai->alsa.chunk_size) {
- if (ret < 0) {
- MP_ERR(ai, "\nError reading audio: %s\n", snd_strerror(ret));
- if (ret == -EPIPE) {
- if (ai_alsa_xrun(ai) == 0) {
- MP_ERR(ai, "Recovered from cross-run, some frames may be left out!\n");
- } else {
- MP_ERR(ai, "Fatal error, cannot recover!\n");
- }
- }
- } else {
- MP_ERR(ai, "\nNot enough audio samples!\n");
- }
- return -1;
- }
- return ret;
+ ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
+ if (ret != ai->alsa.chunk_size) {
+ if (ret < 0) {
+ MP_ERR(ai, "\nError reading audio: %s\n", snd_strerror(ret));
+ if (ret == -EPIPE) {
+ if (ai_alsa_xrun(ai) == 0) {
+ MP_ERR(ai, "Recovered from cross-run, some frames may be left out!\n");
+ } else {
+ MP_ERR(ai, "Fatal error, cannot recover!\n");
+ }
+ }
+ } else {
+ MP_ERR(ai, "\nNot enough audio samples!\n");
+ }
+ return -1;
+ }
+ return ret;
#endif
#if HAVE_OSS_AUDIO
case AUDIO_IN_OSS:
- ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
+ ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
if (ret != ai->blocksize) {
if (ret < 0) {
MP_ERR(ai, "\nError reading audio: %s\n", strerror(errno));
@@ -280,17 +280,17 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
#if HAVE_SNDIO
case AUDIO_IN_SNDIO:
ret = sio_read(ai->sndio.hdl, buffer, ai->blocksize);
- if (ret != ai->blocksize) {
- if (ret < 0) {
- MP_ERR(ai, "\nError reading audio: %s\n", strerror(errno));
- } else {
- MP_ERR(ai, "\nNot enough audio samples!\n");
- }
- return -1;
- }
- return ret;
+ if (ret != ai->blocksize) {
+ if (ret < 0) {
+ MP_ERR(ai, "\nError reading audio: %s\n", strerror(errno));
+ } else {
+ MP_ERR(ai, "\nNot enough audio samples!\n");
+ }
+ return -1;
+ }
+ return ret;
#endif
default:
- return -1;
+ return -1;
}
}
diff --git a/stream/cookies.c b/stream/cookies.c
index a12122f0ac..f8bc852259 100644
--- a/stream/cookies.c
+++ b/stream/cookies.c
@@ -55,7 +55,7 @@ static char *col_dup(void *talloc_ctx, const char *src)
{
int length = 0;
while (src[length] > 31)
- length++;
+ length++;
return talloc_strndup(talloc_ctx, src, length);
}
@@ -67,13 +67,13 @@ static int parse_line(char **ptr, char *cols[7])
cols[0] = *ptr;
for (col = 1; col < 7; col++) {
- for (; (**ptr) > 31; (*ptr)++);
- if (**ptr == 0)
- return 0;
- (*ptr)++;
- if ((*ptr)[-1] != 9)
- return 0;
- cols[col] = (*ptr);
+ for (; (**ptr) > 31; (*ptr)++);
+ if (**ptr == 0)
+ return 0;
+ (*ptr)++;
+ if ((*ptr)[-1] != 9)
+ return 0;
+ cols[col] = (*ptr);
}
return 1;
@@ -89,32 +89,32 @@ static char *load_file(struct mp_log *log, const char *filename, int64_t * lengt
fd = open(filename, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
- mp_verbose(log, "Could not open");
- goto err_out;
+ mp_verbose(log, "Could not open");
+ goto err_out;
}
*length = lseek(fd, 0, SEEK_END);
if (*length < 0) {
- mp_verbose(log, "Could not find EOF");
- goto err_out;
+ mp_verbose(log, "Could not find EOF");
+ goto err_out;
}
if (*length > SIZE_MAX - 1) {
- mp_verbose(log, "File too big, could not malloc.");
- goto err_out;
+ mp_verbose(log, "File too big, could not malloc.");
+ goto err_out;
}
lseek(fd, 0, SEEK_SET);
if (!(buffer = malloc(*length + 1))) {
- mp_verbose(log, "Could not malloc.");
- goto err_out;
+ mp_verbose(log, "Could not malloc.");
+ goto err_out;
}
if (read(fd, buffer, *length) != *length) {
- mp_verbose(log, "Read is behaving funny.");
- goto err_out;
+ mp_verbose(log, "Read is behaving funny.");
+ goto err_out;
}
close(fd);
buffer[*length] = 0;
@@ -137,22 +137,22 @@ static struct cookie_list_type *load_cookies_from(void *ctx,
ptr = file = load_file(log, filename, &length);
if (!ptr)
- return NULL;
+ return NULL;
struct cookie_list_type *list = NULL;
while (*ptr) {
- char *cols[7];
- if (parse_line(&ptr, cols)) {
- struct cookie_list_type *new;
- new = talloc_zero(ctx, cookie_list_t);
- new->name = col_dup(new, cols[5]);
- new->value = col_dup(new, cols[6]);
- new->path = col_dup(new, cols[2]);
- new->domain = col_dup(new, cols[0]);
- new->secure = (*(cols[3]) == 't') || (*(cols[3]) == 'T');
- new->next = list;
- list = new;
- }
+ char *cols[7];
+ if (parse_line(&ptr, cols)) {
+ struct cookie_list_type *new;
+ new = talloc_zero(ctx, cookie_list_t);
+ new->name = col_dup(new, cols[5]);
+ new->value = col_dup(new, cols[6]);
+ new->path = col_dup(new, cols[2]);
+ new->domain = col_dup(new, cols[0]);
+ new->secure = (*(cols[3]) == 't') || (*(cols[3]) == 'T');
+ new->next = list;
+ list = new;
+ }
}
free(file);
return list;
diff --git a/stream/dvb_tune.c b/stream/dvb_tune.c
index 0cf19a8fba..7065a77aa3 100644
--- a/stream/dvb_tune.c
+++ b/stream/dvb_tune.c
@@ -52,225 +52,225 @@ int dvb_get_tuner_type(int fe_fd, struct mp_log *log)
res = ioctl(fe_fd, FE_GET_INFO, &fe_info);
if(res < 0)
{
- mp_err(log, "FE_GET_INFO error: %d, FD: %d\n\n", errno, fe_fd);
- return 0;
+ mp_err(log, "FE_GET_INFO error: %d, FD: %d\n\n", errno, fe_fd);
+ return 0;
}
switch(fe_info.type)
{
- case FE_OFDM:
+ case FE_OFDM:
mp_verbose(log, "TUNER TYPE SEEMS TO BE DVB-T\n");
- return TUNER_TER;
+ return TUNER_TER;
- case FE_QPSK:
+ case FE_QPSK:
mp_verbose(log, "TUNER TYPE SEEMS TO BE DVB-S\n");
- return TUNER_SAT;
+ return TUNER_SAT;
- case FE_QAM:
+ case FE_QAM:
mp_verbose(log, "TUNER TYPE SEEMS TO BE DVB-C\n");
- return TUNER_CBL;
+ return TUNER_CBL;
#ifdef DVB_ATSC
- case FE_ATSC:
+ case FE_ATSC:
mp_verbose(log, "TUNER TYPE SEEMS TO BE DVB-ATSC\n");
- return TUNER_ATSC;
+ return TUNER_ATSC;
#endif
- default:
- mp_err(log, "UNKNOWN TUNER TYPE\n");
- return 0;
+ default:
+ mp_err(log, "UNKNOWN TUNER TYPE\n");
+ return 0;
}
}
int dvb_open_devices(dvb_priv_t *priv, int n, int demux_cnt)
{
- int i;
- char frontend_dev[32], dvr_dev[32], demux_dev[32];
-
- sprintf(frontend_dev, "/dev/dvb/adapter%d/frontend0", n);
- sprintf(dvr_dev, "/dev/dvb/adapter%d/dvr0", n);
- sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", n);
- priv->fe_fd = open(frontend_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
- if(priv->fe_fd < 0)
- {
- MP_ERR(priv, "ERROR OPENING FRONTEND DEVICE %s: ERRNO %d\n", frontend_dev, errno);
- return 0;
- }
- priv->demux_fds_cnt = 0;
- MP_VERBOSE(priv, "DVB_OPEN_DEVICES(%d)\n", demux_cnt);
- for(i = 0; i < demux_cnt; i++)
- {
- priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
- if(priv->demux_fds[i] < 0)
- {
- MP_ERR(priv, "ERROR OPENING DEMUX 0: %d\n", errno);
- return 0;
- }
- else
- {
- MP_VERBOSE(priv, "OPEN(%d), file %s: FD=%d, CNT=%d\n", i, demux_dev, priv->demux_fds[i], priv->demux_fds_cnt);
- priv->demux_fds_cnt++;
- }
- }
-
-
- priv->dvr_fd = open(dvr_dev, O_RDONLY| O_NONBLOCK | O_CLOEXEC);
- if(priv->dvr_fd < 0)
- {
- MP_ERR(priv, "ERROR OPENING DVR DEVICE %s: %d\n", dvr_dev, errno);
- return 0;
- }
-
- return 1;
+ int i;
+ char frontend_dev[32], dvr_dev[32], demux_dev[32];
+
+ sprintf(frontend_dev, "/dev/dvb/adapter%d/frontend0", n);
+ sprintf(dvr_dev, "/dev/dvb/adapter%d/dvr0", n);
+ sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", n);
+ priv->fe_fd = open(frontend_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
+ if(priv->fe_fd < 0)
+ {
+ MP_ERR(priv, "ERROR OPENING FRONTEND DEVICE %s: ERRNO %d\n", frontend_dev, errno);
+ return 0;
+ }
+ priv->demux_fds_cnt = 0;
+ MP_VERBOSE(priv, "DVB_OPEN_DEVICES(%d)\n", demux_cnt);
+ for(i = 0; i < demux_cnt; i++)
+ {
+ priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
+ if(priv->demux_fds[i] < 0)
+ {
+ MP_ERR(priv, "ERROR OPENING DEMUX 0: %d\n", errno);
+ return 0;
+ }
+ else
+ {
+ MP_VERBOSE(priv, "OPEN(%d), file %s: FD=%d, CNT=%d\n", i, demux_dev, priv->demux_fds[i], priv->demux_fds_cnt);
+ priv->demux_fds_cnt++;
+ }
+ }
+
+
+ priv->dvr_fd = open(dvr_dev, O_RDONLY| O_NONBLOCK | O_CLOEXEC);
+ if(priv->dvr_fd < 0)
+ {
+ MP_ERR(priv, "ERROR OPENING DVR DEVICE %s: %d\n", dvr_dev, errno);
+ return 0;
+ }
+
+ return 1;
}
int dvb_fix_demuxes(dvb_priv_t *priv, int cnt)
{
- int i;
- char demux_dev[32];
-
- sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", priv->card);
- MP_VERBOSE(priv, "FIX %d -> %d\n", priv->demux_fds_cnt, cnt);
- if(priv->demux_fds_cnt >= cnt)
- {
- for(i = priv->demux_fds_cnt-1; i >= cnt; i--)
- {
- MP_VERBOSE(priv, "FIX, CLOSE fd(%d): %d\n", i, priv->demux_fds[i]);
- close(priv->demux_fds[i]);
- }
- priv->demux_fds_cnt = cnt;
- }
- else if(priv->demux_fds_cnt < cnt)
- {
- for(i = priv->demux_fds_cnt; i < cnt; i++)
- {
- priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
- MP_VERBOSE(priv, "FIX, OPEN fd(%d): %d\n", i, priv->demux_fds[i]);
- if(priv->demux_fds[i] < 0)
- {
- MP_ERR(priv, "ERROR OPENING DEMUX 0: %d\n", errno);
- return 0;
- }
- else
- priv->demux_fds_cnt++;
- }
- }
-
- return 1;
+ int i;
+ char demux_dev[32];
+
+ sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", priv->card);
+ MP_VERBOSE(priv, "FIX %d -> %d\n", priv->demux_fds_cnt, cnt);
+ if(priv->demux_fds_cnt >= cnt)
+ {
+ for(i = priv->demux_fds_cnt-1; i >= cnt; i--)
+ {
+ MP_VERBOSE(priv, "FIX, CLOSE fd(%d): %d\n", i, priv->demux_fds[i]);
+ close(priv->demux_fds[i]);
+ }
+ priv->demux_fds_cnt = cnt;
+ }
+ else if(priv->demux_fds_cnt < cnt)
+ {
+ for(i = priv->demux_fds_cnt; i < cnt; i++)
+ {
+ priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK | O_CLOEXEC);
+ MP_VERBOSE(priv, "FIX, OPEN fd(%d): %d\n", i, priv->demux_fds[i]);
+ if(priv->demux_fds[i] < 0)
+ {
+ MP_ERR(priv, "ERROR OPENING DEMUX 0: %d\n", errno);
+ return 0;
+ }
+ else
+ priv->demux_fds_cnt++;
+ }
+ }
+
+ return 1;
}
int dvb_set_ts_filt(dvb_priv_t *priv, int fd, uint16_t pid, dmx_pes_type_t pestype)
{
- int i;
- struct dmx_pes_filter_params pesFilterParams;
-
- pesFilterParams.pid = pid;
- pesFilterParams.input = DMX_IN_FRONTEND;
- pesFilterParams.output = DMX_OUT_TS_TAP;
- pesFilterParams.pes_type = pestype;
- pesFilterParams.flags = DMX_IMMEDIATE_START;
-
- errno = 0;
- if ((i = ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams)) < 0)
- {
- MP_ERR(priv, "ERROR IN SETTING DMX_FILTER %i for fd %d: ERRNO: %d", pid, fd, errno);
- return 0;
- }
-
- MP_VERBOSE(priv, "SET PES FILTER ON PID %d to fd %d, RESULT: %d, ERRNO: %d\n", pid, fd, i, errno);
- return 1;
+ int i;
+ struct dmx_pes_filter_params pesFilterParams;
+
+ pesFilterParams.pid = pid;
+ pesFilterParams.input = DMX_IN_FRONTEND;
+ pesFilterParams.output = DMX_OUT_TS_TAP;
+ pesFilterParams.pes_type = pestype;
+ pesFilterParams.flags = DMX_IMMEDIATE_START;
+
+ errno = 0;
+ if ((i = ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams)) < 0)
+ {
+ MP_ERR(priv, "ERROR IN SETTING DMX_FILTER %i for fd %d: ERRNO: %d", pid, fd, errno);
+ return 0;
+ }
+
+ MP_VERBOSE(priv, "SET PES FILTER ON PID %d to fd %d, RESULT: %d, ERRNO: %d\n", pid, fd, i, errno);
+ return 1;
}
int dvb_demux_stop(int fd)
{
- int i;
- i = ioctl(fd, DMX_STOP);
+ int i;
+ i = ioctl(fd, DMX_STOP);
- return i == 0;
+ return i == 0;
}
int dvb_demux_start(int fd)
{
- int i;
- i = ioctl(fd, DMX_START);
+ int i;
+ i = ioctl(fd, DMX_START);
- return i == 0;
+ return i == 0;
}
static void print_status(dvb_priv_t *priv, fe_status_t festatus)
{
- MP_VERBOSE(priv, "FE_STATUS:");
- if (festatus & FE_HAS_SIGNAL) MP_VERBOSE(priv, " FE_HAS_SIGNAL");
- if (festatus & FE_TIMEDOUT) MP_VERBOSE(priv, " FE_TIMEDOUT");
- if (festatus & FE_HAS_LOCK) MP_VERBOSE(priv, " FE_HAS_LOCK");
- if (festatus & FE_HAS_CARRIER) MP_VERBOSE(priv, " FE_HAS_CARRIER");
- if (festatus & FE_HAS_VITERBI) MP_VERBOSE(priv, " FE_HAS_VITERBI");
- if (festatus & FE_HAS_SYNC) MP_VERBOSE(priv, " FE_HAS_SYNC");
- MP_VERBOSE(priv, "\n");
+ MP_VERBOSE(priv, "FE_STATUS:");
+ if (festatus & FE_HAS_SIGNAL) MP_VERBOSE(priv, " FE_HAS_SIGNAL");
+ if (festatus & FE_TIMEDOUT) MP_VERBOSE(priv, " FE_TIMEDOUT");
+ if (festatus & FE_HAS_LOCK) MP_VERBOSE(priv, " FE_HAS_LOCK");
+ if (festatus & FE_HAS_CARRIER) MP_VERBOSE(priv, " FE_HAS_CARRIER");
+ if (festatus & FE_HAS_VITERBI) MP_VERBOSE(priv, " FE_HAS_VITERBI");
+ if (festatus & FE_HAS_SYNC) MP_VERBOSE(priv, " FE_HAS_SYNC");
+ MP_VERBOSE(priv, "\n");
}
static int check_status(dvb_priv_t *priv, int fd_frontend, int tmout)
{
- int32_t strength;
- fe_status_t festatus;
- struct pollfd pfd[1];
- int ok=0, locks=0;
- time_t tm1, tm2;
-
- pfd[0].fd = fd_frontend;
- pfd[0].events = POLLPRI;
-
- MP_VERBOSE(priv, "Getting frontend status\n");
- tm1 = tm2 = time((time_t*) NULL);
- while(!ok)
- {
- festatus = 0;
- if(poll(pfd,1,tmout*1000) > 0)
- {
- if (pfd[0].revents & POLLPRI)
- {
- if(ioctl(fd_frontend, FE_READ_STATUS, &festatus) >= 0)
- if(festatus & FE_HAS_LOCK)
- locks++;
- }
- }
- usleep(10000);
- tm2 = time((time_t*) NULL);
- if((festatus & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= tmout))
- ok = 1;
- }
-
- if(festatus & FE_HAS_LOCK)
- {
- strength=0;
- if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0)
- MP_VERBOSE(priv, "Bit error rate: %d\n",strength);
-
- strength=0;
- if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0)
- MP_VERBOSE(priv, "Signal strength: %d\n",strength);
-
- strength=0;
- if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0)
- MP_VERBOSE(priv, "SNR: %d\n",strength);
-
- strength=0;
- if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0)
- MP_VERBOSE(priv, "UNC: %d\n",strength);
-
- print_status(priv, festatus);
- }
- else
- {
- MP_ERR(priv, "Not able to lock to the signal on the given frequency, timeout: %d\n", tmout);
- return -1;
- }
- return 0;
+ int32_t strength;
+ fe_status_t festatus;
+ struct pollfd pfd[1];
+ int ok=0, locks=0;
+ time_t tm1, tm2;
+
+ pfd[0].fd = fd_frontend;
+ pfd[0].events = POLLPRI;
+
+ MP_VERBOSE(priv, "Getting frontend status\n");
+ tm1 = tm2 = time((time_t*) NULL);
+ while(!ok)
+ {
+ festatus = 0;
+ if(poll(pfd,1,tmout*1000) > 0)
+ {
+ if (pfd[0].revents & POLLPRI)
+ {
+ if(ioctl(fd_frontend, FE_READ_STATUS, &festatus) >= 0)
+ if(festatus & FE_HAS_LOCK)
+ locks++;
+ }
+ }
+ usleep(10000);
+ tm2 = time((time_t*) NULL);
+ if((festatus & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= tmout))
+ ok = 1;
+ }
+
+ if(festatus & FE_HAS_LOCK)
+ {
+ strength=0;
+ if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0)
+ MP_VERBOSE(priv, "Bit error rate: %d\n",strength);
+
+ strength=0;
+ if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0)
+ MP_VERBOSE(priv, "Signal strength: %d\n",strength);
+
+ strength=0;
+ if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0)
+ MP_VERBOSE(priv, "SNR: %d\n",strength);
+
+ strength=0;
+ if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0)
+ MP_VERBOSE(priv, "UNC: %d\n",strength);
+
+ print_status(priv, festatus);
+ }
+ else
+ {
+ MP_ERR(priv, "Not able to lock to the signal on the given frequency, timeout: %d\n", tmout);
+ return -1;
+ }
+ return 0;
}
@@ -280,7 +280,7 @@ struct diseqc_cmd {
};
static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
- fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
+ fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
{
if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1)
return -1;
@@ -314,14 +314,14 @@ static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo)
0xf0 | (((sat_no * 4) & 0x0f) | (hi_lo ? 1 : 0) | (polv ? 0 : 2));
return diseqc_send_msg(secfd, polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18,
- &cmd, hi_lo ? SEC_TONE_ON : SEC_TONE_OFF,
- (sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A);
+ &cmd, hi_lo ? SEC_TONE_ON : SEC_TONE_OFF,
+ (sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A);
}
static int tune_it(dvb_priv_t *priv, int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone,
- fe_spectral_inversion_t specInv, unsigned int diseqc, fe_modulation_t modulation, fe_code_rate_t HP_CodeRate,
- fe_transmit_mode_t TransmissionMode, fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth,
- fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
+ fe_spectral_inversion_t specInv, unsigned int diseqc, fe_modulation_t modulation, fe_code_rate_t HP_CodeRate,
+ fe_transmit_mode_t TransmissionMode, fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth,
+ fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
{
int hi_lo = 0, dfd;
struct dvb_frontend_parameters feparams;
@@ -423,18 +423,18 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend, int fd_sec, unsigned int f
int dvb_tune(dvb_priv_t *priv, int freq, char pol, int srate, int diseqc, int tone,
- fe_spectral_inversion_t specInv, fe_modulation_t modulation, fe_guard_interval_t guardInterval,
- fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_code_rate_t HP_CodeRate,
- fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
+ fe_spectral_inversion_t specInv, fe_modulation_t modulation, fe_guard_interval_t guardInterval,
+ fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_code_rate_t HP_CodeRate,
+ fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
{
- int ris;
+ int ris;
- MP_INFO(priv, "dvb_tune Freq: %lu\n", (long unsigned int) freq);
+ MP_INFO(priv, "dvb_tune Freq: %lu\n", (long unsigned int) freq);
- ris = tune_it(priv, priv->fe_fd, priv->sec_fd, freq, srate, pol, tone, specInv, diseqc, modulation, HP_CodeRate, TransmissionMode, guardInterval, bandWidth, LP_CodeRate, hier, timeout);
+ ris = tune_it(priv, priv->fe_fd, priv->sec_fd, freq, srate, pol, tone, specInv, diseqc, modulation, HP_CodeRate, TransmissionMode, guardInterval, bandWidth, LP_CodeRate, hier, timeout);
- if(ris != 0)
- MP_INFO(priv, "dvb_tune, TUNING FAILED\n");
+ if(ris != 0)
+ MP_INFO(priv, "dvb_tune, TUNING FAILED\n");
- return ris == 0;
+ return ris == 0;
}
diff --git a/stream/dvbin.h b/stream/dvbin.h
index 38b1d15c6d..4caba45c7d 100644
--- a/stream/dvbin.h
+++ b/stream/dvbin.h
@@ -43,54 +43,54 @@
#endif
typedef struct {
- char *name;
- int freq, srate, diseqc, tone;
- char pol;
- int tpid, dpid1, dpid2, progid, ca, pids[DMX_FILTER_SIZE], pids_cnt;
- fe_spectral_inversion_t inv;
- fe_modulation_t mod;
- fe_transmit_mode_t trans;
- fe_bandwidth_t bw;
- fe_guard_interval_t gi;
- fe_code_rate_t cr, cr_lp;
- fe_hierarchy_t hier;
+ char *name;
+ int freq, srate, diseqc, tone;
+ char pol;
+ int tpid, dpid1, dpid2, progid, ca, pids[DMX_FILTER_SIZE], pids_cnt;
+ fe_spectral_inversion_t inv;
+ fe_modulation_t mod;
+ fe_transmit_mode_t trans;
+ fe_bandwidth_t bw;
+ fe_guard_interval_t gi;
+ fe_code_rate_t cr, cr_lp;
+ fe_hierarchy_t hier;
} dvb_channel_t;
typedef struct {
- uint16_t NUM_CHANNELS;
- uint16_t current;
- dvb_channel_t *channels;
+ uint16_t NUM_CHANNELS;
+ uint16_t current;
+ dvb_channel_t *channels;
} dvb_channels_list;
typedef struct {
- int type;
- dvb_channels_list *list;
- char *name;
- int devno;
+ int type;
+ dvb_channels_list *list;
+ char *name;
+ int devno;
} dvb_card_config_t;
typedef struct {
- int count;
- dvb_card_config_t *cards;
- void *priv;
+ int count;
+ dvb_card_config_t *cards;
+ void *priv;
} dvb_config_t;
typedef struct {
struct mp_log *log;
int fd;
- int card;
- int fe_fd;
- int sec_fd;
- int demux_fd[3], demux_fds[DMX_FILTER_SIZE], demux_fds_cnt;
- int dvr_fd;
-
- dvb_config_t *config;
- dvb_channels_list *list;
- int tuner_type;
- int is_on;
- int retry;
- int timeout;
- int last_freq;
+ int card;
+ int fe_fd;
+ int sec_fd;
+ int demux_fd[3], demux_fds[DMX_FILTER_SIZE], demux_fds_cnt;
+ int dvr_fd;
+
+ dvb_config_t *config;
+ dvb_channels_list *list;
+ int tuner_type;
+ int is_on;
+ int retry;
+ int timeout;
+ int last_freq;
char *cfg_prog;
int cfg_card;
@@ -98,10 +98,10 @@ typedef struct {
} dvb_priv_t;
-#define TUNER_SAT 1
-#define TUNER_TER 2
-#define TUNER_CBL 3
-#define TUNER_ATSC 4
+#define TUNER_SAT 1
+#define TUNER_TER 2
+#define TUNER_CBL 3
+#define TUNER_ATSC 4
int dvb_step_channel(stream_t *, int);
int dvb_set_channel(stream_t *, int, int);
diff --git a/stream/frequencies.c b/stream/frequencies.c
index 0ac9e483ee..ff020fabe6 100644
--- a/stream/frequencies.c
+++ b/stream/frequencies.c
@@ -25,371 +25,371 @@
/* US broadcast */
static const struct CHANLIST ntsc_bcast[] = {
- { "2", 55250 },
- { "3", 61250 },
- { "4", 67250 },
- { "5", 77250 },
- { "6", 83250 },
- { "7", 175250 },
- { "8", 181250 },
- { "9", 187250 },
- { "10", 193250 },
- { "11", 199250 },
- { "12", 205250 },
- { "13", 211250 },
- { "14", 471250 },
- { "15", 477250 },
- { "16", 483250 },
- { "17", 489250 },
- { "18", 495250 },
- { "19", 501250 },
- { "20", 507250 },
- { "21", 513250 },
- { "22", 519250 },
- { "23", 525250 },
- { "24", 531250 },
- { "25", 537250 },
- { "26", 543250 },
- { "27", 549250 },
- { "28", 555250 },
- { "29", 561250 },
- { "30", 567250 },
- { "31", 573250 },
- { "32", 579250 },
- { "33", 585250 },
- { "34", 591250 },
- { "35", 597250 },
- { "36", 603250 },
- { "37", 609250 },
- { "38", 615250 },
- { "39", 621250 },
- { "40", 627250 },
- { "41", 633250 },
- { "42", 639250 },
- { "43", 645250 },
- { "44", 651250 },
- { "45", 657250 },
- { "46", 663250 },
- { "47", 669250 },
- { "48", 675250 },
- { "49", 681250 },
- { "50", 687250 },
- { "51", 693250 },
- { "52", 699250 },
- { "53", 705250 },
- { "54", 711250 },
- { "55", 717250 },
- { "56", 723250 },
- { "57", 729250 },
- { "58", 735250 },
- { "59", 741250 },
- { "60", 747250 },
- { "61", 753250 },
- { "62", 759250 },
- { "63", 765250 },
- { "64", 771250 },
- { "65", 777250 },
- { "66", 783250 },
- { "67", 789250 },
- { "68", 795250 },
- { "69", 801250 },
+ { "2", 55250 },
+ { "3", 61250 },
+ { "4", 67250 },
+ { "5", 77250 },
+ { "6", 83250 },
+ { "7", 175250 },
+ { "8", 181250 },
+ { "9", 187250 },
+ { "10", 193250 },
+ { "11", 199250 },
+ { "12", 205250 },
+ { "13", 211250 },
+ { "14", 471250 },
+ { "15", 477250 },
+ { "16", 483250 },
+ { "17", 489250 },
+ { "18", 495250 },
+ { "19", 501250 },
+ { "20", 507250 },
+ { "21", 513250 },
+ { "22", 519250 },
+ { "23", 525250 },
+ { "24", 531250 },
+ { "25", 537250 },
+ { "26", 543250 },
+ { "27", 549250 },
+ { "28", 555250 },
+ { "29", 561250 },
+ { "30", 567250 },
+ { "31", 573250 },
+ { "32", 579250 },
+ { "33", 585250 },
+ { "34", 591250 },
+ { "35", 597250 },
+ { "36", 603250 },
+ { "37", 609250 },
+ { "38", 615250 },
+ { "39", 621250 },
+ { "40", 627250 },
+ { "41", 633250 },
+ { "42", 639250 },
+ { "43", 645250 },
+ { "44", 651250 },
+ { "45", 657250 },
+ { "46", 663250 },
+ { "47", 669250 },
+ { "48", 675250 },
+ { "49", 681250 },
+ { "50", 687250 },
+ { "51", 693250 },
+ { "52", 699250 },
+ { "53", 705250 },
+ { "54", 711250 },
+ { "55", 717250 },
+ { "56", 723250 },
+ { "57", 729250 },
+ { "58", 735250 },
+ { "59", 741250 },
+ { "60", 747250 },
+ { "61", 753250 },
+ { "62", 759250 },
+ { "63", 765250 },
+ { "64", 771250 },
+ { "65", 777250 },
+ { "66", 783250 },
+ { "67", 789250 },
+ { "68", 795250 },
+ { "69", 801250 },
- { "70", 807250 },
- { "71", 813250 },
- { "72", 819250 },
- { "73", 825250 },
- { "74", 831250 },
- { "75", 837250 },
- { "76", 843250 },
- { "77", 849250 },
- { "78", 855250 },
- { "79", 861250 },
- { "80", 867250 },
- { "81", 873250 },
- { "82", 879250 },
- { "83", 885250 },
+ { "70", 807250 },
+ { "71", 813250 },
+ { "72", 819250 },
+ { "73", 825250 },
+ { "74", 831250 },
+ { "75", 837250 },
+ { "76", 843250 },
+ { "77", 849250 },
+ { "78", 855250 },
+ { "79", 861250 },
+ { "80", 867250 },
+ { "81", 873250 },
+ { "82", 879250 },
+ { "83", 885250 },
};
/* US cable */
static const struct CHANLIST ntsc_cable[] = {
- { "1", 73250 },
- { "2", 55250 },
- { "3", 61250 },
- { "4", 67250 },
- { "5", 77250 },
- { "6", 83250 },
- { "7", 175250 },
- { "8", 181250 },
- { "9", 187250 },
- { "10", 193250 },
- { "11", 199250 },
- { "12", 205250 },
+ { "1", 73250 },
+ { "2", 55250 },
+ { "3", 61250 },
+ { "4", 67250 },
+ { "5", 77250 },
+ { "6", 83250 },
+ { "7", 175250 },
+ { "8", 181250 },
+ { "9", 187250 },
+ { "10", 193250 },
+ { "11", 199250 },
+ { "12", 205250 },
- { "13", 211250 },
- { "14", 121250 },
- { "15", 127250 },
- { "16", 133250 },
- { "17", 139250 },
- { "18", 145250 },
- { "19", 151250 },
- { "20", 157250 },
+ { "13", 211250 },
+ { "14", 121250 },
+ { "15", 127250 },
+ { "16", 133250 },
+ { "17", 139250 },
+ { "18", 145250 },
+ { "19", 151250 },
+ { "20", 157250 },
- { "21", 163250 },
- { "22", 169250 },
- { "23", 217250 },
- { "24", 223250 },
- { "25", 229250 },
- { "26", 235250 },
- { "27", 241250 },
- { "28", 247250 },
- { "29", 253250 },
- { "30", 259250 },
- { "31", 265250 },
- { "32", 271250 },
- { "33", 277250 },
- { "34", 283250 },
- { "35", 289250 },
- { "36", 295250 },
- { "37", 301250 },
- { "38", 307250 },
- { "39", 313250 },
- { "40", 319250 },
- { "41", 325250 },
- { "42", 331250 },
- { "43", 337250 },
- { "44", 343250 },
- { "45", 349250 },
- { "46", 355250 },
- { "47", 361250 },
- { "48", 367250 },
- { "49", 373250 },
- { "50", 379250 },
- { "51", 385250 },
- { "52", 391250 },
- { "53", 397250 },
- { "54", 403250 },
- { "55", 409250 },
- { "56", 415250 },
- { "57", 421250 },
- { "58", 427250 },
- { "59", 433250 },
- { "60", 439250 },
- { "61", 445250 },
- { "62", 451250 },
- { "63", 457250 },
- { "64", 463250 },
- { "65", 469250 },
- { "66", 475250 },
- { "67", 481250 },
- { "68", 487250 },
- { "69", 493250 },
+ { "21", 163250 },
+ { "22", 169250 },
+ { "23", 217250 },
+ { "24", 223250 },
+ { "25", 229250 },
+ { "26", 235250 },
+ { "27", 241250 },
+ { "28", 247250 },
+ { "29", 253250 },
+ { "30", 259250 },
+ { "31", 265250 },
+ { "32", 271250 },
+ { "33", 277250 },
+ { "34", 283250 },
+ { "35", 289250 },
+ { "36", 295250 },
+ { "37", 301250 },
+ { "38", 307250 },
+ { "39", 313250 },
+ { "40", 319250 },
+ { "41", 325250 },
+ { "42", 331250 },
+ { "43", 337250 },
+ { "44", 343250 },
+ { "45", 349250 },
+ { "46", 355250 },
+ { "47", 361250 },
+ { "48", 367250 },
+ { "49", 373250 },
+ { "50", 379250 },
+ { "51", 385250 },
+ { "52", 391250 },
+ { "53", 397250 },
+ { "54", 403250 },
+ { "55", 409250 },
+ { "56", 415250 },
+ { "57", 421250 },
+ { "58", 427250 },
+ { "59", 433250 },
+ { "60", 439250 },
+ { "61", 445250 },
+ { "62", 451250 },
+ { "63", 457250 },
+ { "64", 463250 },
+ { "65", 469250 },
+ { "66", 475250 },
+ { "67", 481250 },
+ { "68", 487250 },
+ { "69", 493250 },
- { "70", 499250 },
- { "71", 505250 },
- { "72", 511250 },
- { "73", 517250 },
- { "74", 523250 },
- { "75", 529250 },
- { "76", 535250 },
- { "77", 541250 },
- { "78", 547250 },
- { "79", 553250 },
- { "80", 559250 },
- { "81", 565250 },
- { "82", 571250 },
- { "83", 577250 },
- { "84", 583250 },
- { "85", 589250 },
- { "86", 595250 },
- { "87", 601250 },
- { "88", 607250 },
- { "89", 613250 },
- { "90", 619250 },
- { "91", 625250 },
- { "92", 631250 },
- { "93", 637250 },
- { "94", 643250 },
- { "95", 91250 },
- { "96", 97250 },
- { "97", 103250 },
- { "98", 109250 },
- { "99", 115250 },
- { "100", 649250 },
- { "101", 655250 },
- { "102", 661250 },
- { "103", 667250 },
- { "104", 673250 },
- { "105", 679250 },
- { "106", 685250 },
- { "107", 691250 },
- { "108", 697250 },
- { "109", 703250 },
- { "110", 709250 },
- { "111", 715250 },
- { "112", 721250 },
- { "113", 727250 },
- { "114", 733250 },
- { "115", 739250 },
- { "116", 745250 },
- { "117", 751250 },
- { "118", 757250 },
- { "119", 763250 },
- { "120", 769250 },
- { "121", 775250 },
- { "122", 781250 },
- { "123", 787250 },
- { "124", 793250 },
- { "125", 799250 },
+ { "70", 499250 },
+ { "71", 505250 },
+ { "72", 511250 },
+ { "73", 517250 },
+ { "74", 523250 },
+ { "75", 529250 },
+ { "76", 535250 },
+ { "77", 541250 },
+ { "78", 547250 },
+ { "79", 553250 },
+ { "80", 559250 },
+ { "81", 565250 },
+ { "82", 571250 },
+ { "83", 577250 },
+ { "84", 583250 },
+ { "85", 589250 },
+ { "86", 595250 },
+ { "87", 601250 },
+ { "88", 607250 },
+ { "89", 613250 },
+ { "90", 619250 },
+ { "91", 625250 },
+ { "92", 631250 },
+ { "93", 637250 },
+ { "94", 643250 },
+ { "95", 91250 },
+ { "96", 97250 },
+ { "97", 103250 },
+ { "98", 109250 },
+ { "99", 115250 },
+ { "100", 649250 },
+ { "101", 655250 },
+ { "102", 661250 },
+ { "103", 667250 },
+ { "104", 673250 },
+ { "105", 679250 },
+ { "106", 685250 },
+ { "107", 691250 },
+ { "108", 697250 },
+ { "109", 703250 },
+ { "110", 709250 },
+ { "111", 715250 },
+ { "112", 721250 },
+ { "113", 727250 },
+ { "114", 733250 },
+ { "115", 739250 },
+ { "116", 745250 },
+ { "117", 751250 },
+ { "118", 757250 },
+ { "119", 763250 },
+ { "120", 769250 },
+ { "121", 775250 },
+ { "122", 781250 },
+ { "123", 787250 },
+ { "124", 793250 },
+ { "125", 799250 },
- { "T7", 8250 },
- { "T8", 14250 },
- { "T9", 20250 },
- { "T10", 26250 },
- { "T11", 32250 },
- { "T12", 38250 },
- { "T13", 44250 },
- { "T14", 50250 }
+ { "T7", 8250 },
+ { "T8", 14250 },
+ { "T9", 20250 },
+ { "T10", 26250 },
+ { "T11", 32250 },
+ { "T12", 38250 },
+ { "T13", 44250 },
+ { "T14", 50250 }
};
/* US HRC */
static const struct CHANLIST ntsc_hrc[] = {
- { "1", 72000 },
- { "2", 54000 },
- { "3", 60000 },
- { "4", 66000 },
- { "5", 78000 },
- { "6", 84000 },
- { "7", 174000 },
- { "8", 180000 },
- { "9", 186000 },
- { "10", 192000 },
- { "11", 198000 },
- { "12", 204000 },
+ { "1", 72000 },
+ { "2", 54000 },
+ { "3", 60000 },
+ { "4", 66000 },
+ { "5", 78000 },
+ { "6", 84000 },
+ { "7", 174000 },
+ { "8", 180000 },
+ { "9", 186000 },
+ { "10", 192000 },
+ { "11", 198000 },
+ { "12", 204000 },
- { "13", 210000 },
- { "14", 120000 },
- { "15", 126000 },
- { "16", 132000 },
- { "17", 138000 },
- { "18", 144000 },
- { "19", 150000 },
- { "20", 156000 },
+ { "13", 210000 },
+ { "14", 120000 },
+ { "15", 126000 },
+ { "16", 132000 },
+ { "17", 138000 },
+ { "18", 144000 },
+ { "19", 150000 },
+ { "20", 156000 },
- { "21", 162000 },
- { "22", 168000 },
- { "23", 216000 },
- { "24", 222000 },
- { "25", 228000 },
- { "26", 234000 },
- { "27", 240000 },
- { "28", 246000 },
- { "29", 252000 },
- { "30", 258000 },
- { "31", 264000 },
- { "32", 270000 },
- { "33", 276000 },
- { "34", 282000 },
- { "35", 288000 },
- { "36", 294000 },
- { "37", 300000 },
- { "38", 306000 },
- { "39", 312000 },
- { "40", 318000 },
- { "41", 324000 },
- { "42", 330000 },
- { "43", 336000 },
- { "44", 342000 },
- { "45", 348000 },
- { "46", 354000 },
- { "47", 360000 },
- { "48", 366000 },
- { "49", 372000 },
- { "50", 378000 },
- { "51", 384000 },
- { "52", 390000 },
- { "53", 396000 },
- { "54", 402000 },
- { "55", 408000 },
- { "56", 414000 },
- { "57", 420000 },
- { "58", 426000 },
- { "59", 432000 },
- { "60", 438000 },
- { "61", 444000 },
- { "62", 450000 },
- { "63", 456000 },
- { "64", 462000 },
- { "65", 468000 },
- { "66", 474000 },
- { "67", 480000 },
- { "68", 486000 },
- { "69", 492000 },
+ { "21", 162000 },
+ { "22", 168000 },
+ { "23", 216000 },
+ { "24", 222000 },
+ { "25", 228000 },
+ { "26", 234000 },
+ { "27", 240000 },
+ { "28", 246000 },
+ { "29", 252000 },
+ { "30", 258000 },
+ { "31", 264000 },
+ { "32", 270000 },
+ { "33", 276000 },
+ { "34", 282000 },
+ { "35", 288000 },
+ { "36", 294000 },
+ { "37", 300000 },
+ { "38", 306000 },
+ { "39", 312000 },
+ { "40", 318000 },
+ { "41", 324000 },
+ { "42", 330000 },
+ { "43", 336000 },
+ { "44", 342000 },
+ { "45", 348000 },
+ { "46", 354000 },
+ { "47", 360000 },
+ { "48", 366000 },
+ { "49", 372000 },
+ { "50", 378000 },
+ { "51", 384000 },
+ { "52", 390000 },
+ { "53", 396000 },
+ { "54", 402000 },
+ { "55", 408000 },
+ { "56", 414000 },
+ { "57", 420000 },
+ { "58", 426000 },
+ { "59", 432000 },
+ { "60", 438000 },
+ { "61", 444000 },
+ { "62", 450000 },
+ { "63", 456000 },
+ { "64", 462000 },
+ { "65", 468000 },
+ { "66", 474000 },
+ { "67", 480000 },
+ { "68", 486000 },
+ { "69", 492000 },
- { "70", 498000 },
- { "71", 504000 },
- { "72", 510000 },
- { "73", 516000 },
- { "74", 522000 },
- { "75", 528000 },
- { "76", 534000 },
- { "77", 540000 },
- { "78", 546000 },
- { "79", 552000 },
- { "80", 558000 },
- { "81", 564000 },
- { "82", 570000 },
- { "83", 576000 },
- { "84", 582000 },
- { "85", 588000 },
- { "86", 594000 },
- { "87", 600000 },
- { "88", 606000 },
- { "89", 612000 },
- { "90", 618000 },
- { "91", 624000 },
- { "92", 630000 },
- { "93", 636000 },
- { "94", 642000 },
- { "95", 900000 },
- { "96", 960000 },
- { "97", 102000 },
- { "98", 108000 },
- { "99", 114000 },
- { "100", 648000 },
- { "101", 654000 },
- { "102", 660000 },
- { "103", 666000 },
- { "104", 672000 },
- { "105", 678000 },
- { "106", 684000 },
- { "107", 690000 },
- { "108", 696000 },
- { "109", 702000 },
- { "110", 708000 },
- { "111", 714000 },
- { "112", 720000 },
- { "113", 726000 },
- { "114", 732000 },
- { "115", 738000 },
- { "116", 744000 },
- { "117", 750000 },
- { "118", 756000 },
- { "119", 762000 },
- { "120", 768000 },
- { "121", 774000 },
- { "122", 780000 },
- { "123", 786000 },
- { "124", 792000 },
- { "125", 798000 },
+ { "70", 498000 },
+ { "71", 504000 },
+ { "72", 510000 },
+ { "73", 516000 },
+ { "74", 522000 },
+ { "75", 528000 },
+ { "76", 534000 },
+ { "77", 540000 },
+ { "78", 546000 },
+ { "79", 552000 },
+ { "80", 558000 },
+ { "81", 564000 },
+ { "82", 570000 },
+ { "83", 576000 },
+ { "84", 582000 },
+ { "85", 588000 },
+ { "86", 594000 },
+ { "87", 600000 },
+ { "88", 606000 },
+ { "89", 612000 },
+ { "90", 618000 },
+ { "91", 624000 },
+ { "92", 630000 },
+ { "93", 636000 },
+ { "94", 642000 },
+ { "95", 900000 },
+ { "96", 960000 },
+ { "97", 102000 },
+ { "98", 108000 },
+ { "99", 114000 },
+ { "100", 648000 },
+ { "101", 654000 },
+ { "102", 660000 },
+ { "103", 666000 },
+ { "104", 672000 },
+ { "105", 678000 },
+ { "106", 684000 },
+ { "107", 690000 },
+ { "108", 696000 },
+ { "109", 702000 },
+ { "110", 708000 },
+ { "111", 714000 },
+ { "112", 720000 },
+ { "113", 726000 },
+ { "114", 732000 },
+ { "115", 738000 },
+ { "116", 744000 },
+ { "117", 750000 },
+ { "118", 756000 },
+ { "119", 762000 },
+ { "120", 768000 },
+ { "121", 774000 },
+ { "122", 780000 },
+ { "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 },
};
/* --------------------------------------------------------------------- */
@@ -464,117 +464,117 @@ static const struct CHANLIST ntsc_bcast_jp[] = {
/* JP cable */
static const struct CHANLIST ntsc_cable_jp[] = {
- { "13", 109250 },
- { "14", 115250 },
- { "15", 121250 },
- { "16", 127250 },
- { "17", 133250 },
- { "18", 139250 },
- { "19", 145250 },
- { "20", 151250 },
+ { "13", 109250 },
+ { "14", 115250 },
+ { "15", 121250 },
+ { "16", 127250 },
+ { "17", 133250 },
+ { "18", 139250 },
+ { "19", 145250 },
+ { "20", 151250 },
- { "21", 157250 },
- { "22", 165250 },
- { "23", 223250 },
- { "24", 231250 },
- { "25", 237250 },
- { "26", 243250 },
- { "27", 249250 },
- { "28", 253250 },
- { "29", 259250 },
- { "30", 265250 },
- { "31", 271250 },
- { "32", 277250 },
- { "33", 283250 },
- { "34", 289250 },
- { "35", 295250 },
- { "36", 301250 },
- { "37", 307250 },
- { "38", 313250 },
- { "39", 319250 },
- { "40", 325250 },
- { "41", 331250 },
- { "42", 337250 },
- { "43", 343250 },
- { "44", 349250 },
- { "45", 355250 },
- { "46", 361250 },
- { "47", 367250 },
- { "48", 373250 },
- { "49", 379250 },
- { "50", 385250 },
- { "51", 391250 },
- { "52", 397250 },
- { "53", 403250 },
- { "54", 409250 },
- { "55", 415250 },
- { "56", 421250 },
- { "57", 427250 },
- { "58", 433250 },
- { "59", 439250 },
- { "60", 445250 },
- { "61", 451250 },
- { "62", 457250 },
- { "63", 463250 },
+ { "21", 157250 },
+ { "22", 165250 },
+ { "23", 223250 },
+ { "24", 231250 },
+ { "25", 237250 },
+ { "26", 243250 },
+ { "27", 249250 },
+ { "28", 253250 },
+ { "29", 259250 },
+ { "30", 265250 },
+ { "31", 271250 },
+ { "32", 277250 },
+ { "33", 283250 },
+ { "34", 289250 },
+ { "35", 295250 },
+ { "36", 301250 },
+ { "37", 307250 },
+ { "38", 313250 },
+ { "39", 319250 },
+ { "40", 325250 },
+ { "41", 331250 },
+ { "42", 337250 },
+ { "43", 343250 },
+ { "44", 349250 },
+ { "45", 355250 },
+ { "46", 361250 },
+ { "47", 367250 },
+ { "48", 373250 },
+ { "49", 379250 },
+ { "50", 385250 },
+ { "51", 391250 },
+ { "52", 397250 },
+ { "53", 403250 },
+ { "54", 409250 },
+ { "55", 415250 },
+ { "56", 421250 },
+ { "57", 427250 },
+ { "58", 433250 },
+ { "59", 439250 },
+ { "60", 445250 },
+ { "61", 451250 },
+ { "62", 457250 },
+ { "63", 463250 },
};
/* --------------------------------------------------------------------- */
/* australia */
static const struct CHANLIST pal_australia[] = {
- { "0", 46250 },
- { "1", 57250 },
- { "2", 64250 },
- { "3", 86250 },
- { "4", 95250 },
- { "5", 102250 },
- { "5A", 138250 },
- { "6", 175250 },
- { "7", 182250 },
- { "8", 189250 },
- { "9", 196250 },
- { "10", 209250 },
- { "11", 216250 },
- { "28", 527250 },
- { "29", 534250 },
- { "30", 541250 },
- { "31", 548250 },
- { "32", 555250 },
- { "33", 562250 },
- { "34", 569250 },
- { "35", 576250 },
+ { "0", 46250 },
+ { "1", 57250 },
+ { "2", 64250 },
+ { "3", 86250 },
+ { "4", 95250 },
+ { "5", 102250 },
+ { "5A", 138250 },
+ { "6", 175250 },
+ { "7", 182250 },
+ { "8", 189250 },
+ { "9", 196250 },
+ { "10", 209250 },
+ { "11", 216250 },
+ { "28", 527250 },
+ { "29", 534250 },
+ { "30", 541250 },
+ { "31", 548250 },
+ { "32", 555250 },
+ { "33", 562250 },
+ { "34", 569250 },
+ { "35", 576250 },
{ "36", 591250 },
- { "39", 604250 },
- { "40", 611250 },
- { "41", 618250 },
- { "42", 625250 },
- { "43", 632250 },
- { "44", 639250 },
- { "45", 646250 },
- { "46", 653250 },
- { "47", 660250 },
- { "48", 667250 },
- { "49", 674250 },
- { "50", 681250 },
- { "51", 688250 },
- { "52", 695250 },
- { "53", 702250 },
- { "54", 709250 },
- { "55", 716250 },
- { "56", 723250 },
- { "57", 730250 },
- { "58", 737250 },
- { "59", 744250 },
- { "60", 751250 },
- { "61", 758250 },
- { "62", 765250 },
- { "63", 772250 },
- { "64", 779250 },
- { "65", 786250 },
- { "66", 793250 },
- { "67", 800250 },
- { "68", 807250 },
- { "69", 814250 },
+ { "39", 604250 },
+ { "40", 611250 },
+ { "41", 618250 },
+ { "42", 625250 },
+ { "43", 632250 },
+ { "44", 639250 },
+ { "45", 646250 },
+ { "46", 653250 },
+ { "47", 660250 },
+ { "48", 667250 },
+ { "49", 674250 },
+ { "50", 681250 },
+ { "51", 688250 },
+ { "52", 695250 },
+ { "53", 702250 },
+ { "54", 709250 },
+ { "55", 716250 },
+ { "56", 723250 },
+ { "57", 730250 },
+ { "58", 737250 },
+ { "59", 744250 },
+ { "60", 751250 },
+ { "61", 758250 },
+ { "62", 765250 },
+ { "63", 772250 },
+ { "64", 779250 },
+ { "65", 786250 },
+ { "66", 793250 },
+ { "67", 800250 },
+ { "68", 807250 },
+ { "69", 814250 },
};
/* --------------------------------------------------------------------- */
@@ -582,157 +582,157 @@ static const struct CHANLIST pal_australia[] = {
/* CCIR frequencies */
-#define FREQ_CCIR_I_III \
- { "E2", 48250 }, \
- { "E3", 55250 }, \
- { "E4", 62250 }, \
- \
- { "S01", 69250 }, \
- { "S02", 76250 }, \
- { "S03", 83250 }, \
- \
- { "E5", 175250 }, \
- { "E6", 182250 }, \
- { "E7", 189250 }, \
- { "E8", 196250 }, \
- { "E9", 203250 }, \
- { "E10", 210250 }, \
- { "E11", 217250 }, \
- { "E12", 224250 }
+#define FREQ_CCIR_I_III \
+ { "E2", 48250 }, \
+ { "E3", 55250 }, \
+ { "E4", 62250 }, \
+ \
+ { "S01", 69250 }, \
+ { "S02", 76250 }, \
+ { "S03", 83250 }, \
+ \
+ { "E5", 175250 }, \
+ { "E6", 182250 }, \
+ { "E7", 189250 }, \
+ { "E8", 196250 }, \
+ { "E9", 203250 }, \
+ { "E10", 210250 }, \
+ { "E11", 217250 }, \
+ { "E12", 224250 }
-#define FREQ_CCIR_SL_SH \
- { "SE1", 105250 }, \
- { "SE2", 112250 }, \
- { "SE3", 119250 }, \
- { "SE4", 126250 }, \
- { "SE5", 133250 }, \
- { "SE6", 140250 }, \
- { "SE7", 147250 }, \
- { "SE8", 154250 }, \
- { "SE9", 161250 }, \
- { "SE10", 168250 }, \
- \
- { "SE11", 231250 }, \
- { "SE12", 238250 }, \
- { "SE13", 245250 }, \
- { "SE14", 252250 }, \
- { "SE15", 259250 }, \
- { "SE16", 266250 }, \
- { "SE17", 273250 }, \
- { "SE18", 280250 }, \
- { "SE19", 287250 }, \
+#define FREQ_CCIR_SL_SH \
+ { "SE1", 105250 }, \
+ { "SE2", 112250 }, \
+ { "SE3", 119250 }, \
+ { "SE4", 126250 }, \
+ { "SE5", 133250 }, \
+ { "SE6", 140250 }, \
+ { "SE7", 147250 }, \
+ { "SE8", 154250 }, \
+ { "SE9", 161250 }, \
+ { "SE10", 168250 }, \
+ \
+ { "SE11", 231250 }, \
+ { "SE12", 238250 }, \
+ { "SE13", 245250 }, \
+ { "SE14", 252250 }, \
+ { "SE15", 259250 }, \
+ { "SE16", 266250 }, \
+ { "SE17", 273250 }, \
+ { "SE18", 280250 }, \
+ { "SE19", 287250 }, \
{ "SE20", 294250 }
-#define FREQ_CCIR_H \
- { "S21", 303250 }, \
- { "S22", 311250 }, \
- { "S23", 319250 }, \
- { "S24", 327250 }, \
- { "S25", 335250 }, \
- { "S26", 343250 }, \
- { "S27", 351250 }, \
- { "S28", 359250 }, \
- { "S29", 367250 }, \
- { "S30", 375250 }, \
- { "S31", 383250 }, \
- { "S32", 391250 }, \
- { "S33", 399250 }, \
- { "S34", 407250 }, \
- { "S35", 415250 }, \
- { "S36", 423250 }, \
- { "S37", 431250 }, \
- { "S38", 439250 }, \
- { "S39", 447250 }, \
- { "S40", 455250 }, \
+#define FREQ_CCIR_H \
+ { "S21", 303250 }, \
+ { "S22", 311250 }, \
+ { "S23", 319250 }, \
+ { "S24", 327250 }, \
+ { "S25", 335250 }, \
+ { "S26", 343250 }, \
+ { "S27", 351250 }, \
+ { "S28", 359250 }, \
+ { "S29", 367250 }, \
+ { "S30", 375250 }, \
+ { "S31", 383250 }, \
+ { "S32", 391250 }, \
+ { "S33", 399250 }, \
+ { "S34", 407250 }, \
+ { "S35", 415250 }, \
+ { "S36", 423250 }, \
+ { "S37", 431250 }, \
+ { "S38", 439250 }, \
+ { "S39", 447250 }, \
+ { "S40", 455250 }, \
{ "S41", 463250 }
/* OIRT frequencies */
-#define FREQ_OIRT_I_III \
- { "R1", 49750 }, \
- { "R2", 59250 }, \
- \
- { "R3", 77250 }, \
- { "R4", 85250 }, \
- { "R5", 93250 }, \
- \
- { "R6", 175250 }, \
- { "R7", 183250 }, \
- { "R8", 191250 }, \
- { "R9", 199250 }, \
- { "R10", 207250 }, \
- { "R11", 215250 }, \
- { "R12", 223250 }
+#define FREQ_OIRT_I_III \
+ { "R1", 49750 }, \
+ { "R2", 59250 }, \
+ \
+ { "R3", 77250 }, \
+ { "R4", 85250 }, \
+ { "R5", 93250 }, \
+ \
+ { "R6", 175250 }, \
+ { "R7", 183250 }, \
+ { "R8", 191250 }, \
+ { "R9", 199250 }, \
+ { "R10", 207250 }, \
+ { "R11", 215250 }, \
+ { "R12", 223250 }
-#define FREQ_OIRT_SL_SH \
- { "SR1", 111250 }, \
- { "SR2", 119250 }, \
- { "SR3", 127250 }, \
- { "SR4", 135250 }, \
- { "SR5", 143250 }, \
- { "SR6", 151250 }, \
- { "SR7", 159250 }, \
- { "SR8", 167250 }, \
- \
- { "SR11", 231250 }, \
- { "SR12", 239250 }, \
- { "SR13", 247250 }, \
- { "SR14", 255250 }, \
- { "SR15", 263250 }, \
- { "SR16", 271250 }, \
- { "SR17", 279250 }, \
- { "SR18", 287250 }, \
+#define FREQ_OIRT_SL_SH \
+ { "SR1", 111250 }, \
+ { "SR2", 119250 }, \
+ { "SR3", 127250 }, \
+ { "SR4", 135250 }, \
+ { "SR5", 143250 }, \
+ { "SR6", 151250 }, \
+ { "SR7", 159250 }, \
+ { "SR8", 167250 }, \
+ \
+ { "SR11", 231250 }, \
+ { "SR12", 239250 }, \
+ { "SR13", 247250 }, \
+ { "SR14", 255250 }, \
+ { "SR15", 263250 }, \
+ { "SR16", 271250 }, \
+ { "SR17", 279250 }, \
+ { "SR18", 287250 }, \
{ "SR19", 295250 }
-#define FREQ_UHF \
- { "21", 471250 }, \
- { "22", 479250 }, \
- { "23", 487250 }, \
- { "24", 495250 }, \
- { "25", 503250 }, \
- { "26", 511250 }, \
- { "27", 519250 }, \
- { "28", 527250 }, \
- { "29", 535250 }, \
- { "30", 543250 }, \
- { "31", 551250 }, \
- { "32", 559250 }, \
- { "33", 567250 }, \
- { "34", 575250 }, \
- { "35", 583250 }, \
- { "36", 591250 }, \
- { "37", 599250 }, \
- { "38", 607250 }, \
- { "39", 615250 }, \
- { "40", 623250 }, \
- { "41", 631250 }, \
- { "42", 639250 }, \
- { "43", 647250 }, \
- { "44", 655250 }, \
- { "45", 663250 }, \
- { "46", 671250 }, \
- { "47", 679250 }, \
- { "48", 687250 }, \
- { "49", 695250 }, \
- { "50", 703250 }, \
- { "51", 711250 }, \
- { "52", 719250 }, \
- { "53", 727250 }, \
- { "54", 735250 }, \
- { "55", 743250 }, \
- { "56", 751250 }, \
- { "57", 759250 }, \
- { "58", 767250 }, \
- { "59", 775250 }, \
- { "60", 783250 }, \
- { "61", 791250 }, \
- { "62", 799250 }, \
- { "63", 807250 }, \
- { "64", 815250 }, \
- { "65", 823250 }, \
- { "66", 831250 }, \
- { "67", 839250 }, \
- { "68", 847250 }, \
+#define FREQ_UHF \
+ { "21", 471250 }, \
+ { "22", 479250 }, \
+ { "23", 487250 }, \
+ { "24", 495250 }, \
+ { "25", 503250 }, \
+ { "26", 511250 }, \
+ { "27", 519250 }, \
+ { "28", 527250 }, \
+ { "29", 535250 }, \
+ { "30", 543250 }, \
+ { "31", 551250 }, \
+ { "32", 559250 }, \
+ { "33", 567250 }, \
+ { "34", 575250 }, \
+ { "35", 583250 }, \
+ { "36", 591250 }, \
+ { "37", 599250 }, \
+ { "38", 607250 }, \
+ { "39", 615250 }, \
+ { "40", 623250 }, \
+ { "41", 631250 }, \
+ { "42", 639250 }, \
+ { "43", 647250 }, \
+ { "44", 655250 }, \
+ { "45", 663250 }, \
+ { "46", 671250 }, \
+ { "47", 679250 }, \
+ { "48", 687250 }, \
+ { "49", 695250 }, \
+ { "50", 703250 }, \
+ { "51", 711250 }, \
+ { "52", 719250 }, \
+ { "53", 727250 }, \
+ { "54", 735250 }, \
+ { "55", 743250 }, \
+ { "56", 751250 }, \
+ { "57", 759250 }, \
+ { "58", 767250 }, \
+ { "59", 775250 }, \
+ { "60", 783250 }, \
+ { "61", 791250 }, \
+ { "62", 799250 }, \
+ { "63", 807250 }, \
+ { "64", 815250 }, \
+ { "65", 823250 }, \
+ { "66", 831250 }, \
+ { "67", 839250 }, \
+ { "68", 847250 }, \
{ "69", 855250 }
static const struct CHANLIST europe_west[] = {
@@ -752,16 +752,16 @@ static const struct CHANLIST europe_east[] = {
};
static const struct CHANLIST pal_italy[] = {
- { "A", 53750 },
- { "B", 62250 },
- { "C", 82250 },
- { "D", 175250 },
- { "E", 183750 },
- { "F", 192250 },
- { "G", 201250 },
- { "H", 210250 },
- { "H1", 217250 },
- { "H2", 224250 },
+ { "A", 53750 },
+ { "B", 62250 },
+ { "C", 82250 },
+ { "D", 175250 },
+ { "E", 183750 },
+ { "F", 192250 },
+ { "G", 201250 },
+ { "H", 210250 },
+ { "H1", 217250 },
+ { "H2", 224250 },
FREQ_UHF
};
@@ -858,17 +858,17 @@ static const struct CHANLIST secam_france[] = {
/* --------------------------------------------------------------------- */
static const struct CHANLIST pal_newzealand[] = {
- { "1", 45250 },
- { "2", 55250 },
- { "3", 62250 },
- { "4", 175250 },
- { "5", 182250 },
- { "6", 189250 },
- { "7", 196250 },
- { "8", 203250 },
- { "9", 210250 },
- { "10", 217250 },
- { "11", 224250 },
+ { "1", 45250 },
+ { "2", 55250 },
+ { "3", 62250 },
+ { "4", 175250 },
+ { "5", 182250 },
+ { "6", 189250 },
+ { "7", 196250 },
+ { "8", 203250 },
+ { "9", 210250 },
+ { "10", 217250 },
+ { "11", 224250 },
FREQ_UHF,
};
@@ -876,100 +876,100 @@ static const struct CHANLIST pal_newzealand[] = {
/* China broadcast */
static const struct CHANLIST pal_bcast_cn[] = {
- { "1", 49750 },
- { "2", 57750 },
- { "3", 65750 },
- { "4", 77250 },
- { "5", 85250 },
- { "6", 112250 },
- { "7", 120250 },
- { "8", 128250 },
- { "9", 136250 },
- { "10", 144250 },
- { "11", 152250 },
- { "12", 160250 },
- { "13", 168250 },
- { "14", 176250 },
- { "15", 184250 },
- { "16", 192250 },
- { "17", 200250 },
- { "18", 208250 },
- { "19", 216250 },
- { "20", 224250 },
- { "21", 232250 },
- { "22", 240250 },
- { "23", 248250 },
- { "24", 256250 },
- { "25", 264250 },
- { "26", 272250 },
- { "27", 280250 },
- { "28", 288250 },
- { "29", 296250 },
- { "30", 304250 },
- { "31", 312250 },
- { "32", 320250 },
- { "33", 328250 },
- { "34", 336250 },
- { "35", 344250 },
- { "36", 352250 },
- { "37", 360250 },
- { "38", 368250 },
- { "39", 376250 },
- { "40", 384250 },
- { "41", 392250 },
- { "42", 400250 },
- { "43", 408250 },
- { "44", 416250 },
- { "45", 424250 },
- { "46", 432250 },
- { "47", 440250 },
- { "48", 448250 },
- { "49", 456250 },
- { "50", 463250 },
- { "51", 471250 },
- { "52", 479250 },
- { "53", 487250 },
- { "54", 495250 },
- { "55", 503250 },
- { "56", 511250 },
- { "57", 519250 },
- { "58", 527250 },
- { "59", 535250 },
- { "60", 543250 },
- { "61", 551250 },
- { "62", 559250 },
- { "63", 607250 },
- { "64", 615250 },
- { "65", 623250 },
- { "66", 631250 },
- { "67", 639250 },
- { "68", 647250 },
- { "69", 655250 },
- { "70", 663250 },
- { "71", 671250 },
- { "72", 679250 },
- { "73", 687250 },
- { "74", 695250 },
- { "75", 703250 },
- { "76", 711250 },
- { "77", 719250 },
- { "78", 727250 },
- { "79", 735250 },
- { "80", 743250 },
- { "81", 751250 },
- { "82", 759250 },
- { "83", 767250 },
- { "84", 775250 },
- { "85", 783250 },
- { "86", 791250 },
- { "87", 799250 },
- { "88", 807250 },
- { "89", 815250 },
- { "90", 823250 },
- { "91", 831250 },
- { "92", 839250 },
- { "93", 847250 },
- { "94", 855250 },
+ { "1", 49750 },
+ { "2", 57750 },
+ { "3", 65750 },
+ { "4", 77250 },
+ { "5", 85250 },
+ { "6", 112250 },
+ { "7", 120250 },
+ { "8", 128250 },
+ { "9", 136250 },
+ { "10", 144250 },
+ { "11", 152250 },
+ { "12", 160250 },
+ { "13", 168250 },
+ { "14", 176250 },
+ { "15", 184250 },
+ { "16", 192250 },
+ { "17", 200250 },
+ { "18", 208250 },
+ { "19", 216250 },
+ { "20", 224250 },
+ { "21", 232250 },
+ { "22", 240250 },
+ { "23", 248250 },
+ { "24", 256250 },
+ { "25", 264250 },
+ { "26", 272250 },
+ { "27", 280250 },
+ { "28", 288250 },
+ { "29", 296250 },
+ { "30", 304250 },
+ { "31", 312250 },
+ { "32", 320250 },
+ { "33", 328250 },
+ { "34", 336250 },
+ { "35", 344250 },
+ { "36", 352250 },
+ { "37", 360250 },
+ { "38", 368250 },
+ { "39", 376250 },
+ { "40", 384250 },
+ { "41", 392250 },
+ { "42", 400250 },
+ { "43", 408250 },
+ { "44", 416250 },
+ { "45", 424250 },
+ { "46", 432250 },
+ { "47", 440250 },
+ { "48", 448250 },
+ { "49", 456250 },
+ { "50", 463250 },
+ { "51", 471250 },
+ { "52", 479250 },
+ { "53", 487250 },
+ { "54", 495250 },
+ { "55", 503250 },
+ { "56", 511250 },
+ { "57", 519250 },
+ { "58", 527250 },
+ { "59", 535250 },
+ { "60", 543250 },
+ { "61", 551250 },
+ { "62", 559250 },
+ { "63", 607250 },
+ { "64", 615250 },
+ { "65", 623250 },
+ { "66", 631250 },
+ { "67", 639250 },
+ { "68", 647250 },
+ { "69", 655250 },
+ { "70", 663250 },
+ { "71", 671250 },
+ { "72", 679250 },
+ { "73", 687250 },
+ { "74", 695250 },
+ { "75", 703250 },
+ { "76", 711250 },
+ { "77", 719250 },
+ { "78", 727250 },
+ { "79", 735250 },
+ { "80", 743250 },
+ { "81", 751250 },
+ { "82", 759250 },
+ { "83", 767250 },
+ { "84", 775250 },
+ { "85", 783250 },
+ { "86", 791250 },
+ { "87", 799250 },
+ { "88", 807250 },
+ { "89", 815250 },
+ { "90", 823250 },
+ { "91", 831250 },
+ { "92", 839250 },
+ { "93", 847250 },
+ { "94", 855250 },
};
/* --------------------------------------------------------------------- */
@@ -1198,7 +1198,7 @@ const struct CHANLISTS chanlists[] = {
{ "japan-cable", ntsc_cable_jp, CHAN_COUNT(ntsc_cable_jp) },
{ "europe-west", europe_west, CHAN_COUNT(europe_west) },
{ "europe-east", europe_east, CHAN_COUNT(europe_east) },
- { "italy", pal_italy, CHAN_COUNT(pal_italy) },
+ { "italy", pal_italy, CHAN_COUNT(pal_italy) },
{ "newzealand", pal_newzealand, CHAN_COUNT(pal_newzealand) },
{ "australia", pal_australia, CHAN_COUNT(pal_australia) },
{ "ireland", pal_ireland, CHAN_COUNT(pal_ireland) },
diff --git a/stream/frequencies.h b/stream/frequencies.h
index d0711e0cf7..87a5a1fb4f 100644
--- a/stream/frequencies.h
+++ b/stream/frequencies.h
@@ -25,13 +25,13 @@
#ifndef MPLAYER_FREQUENCIES_H
#define MPLAYER_FREQUENCIES_H
-#define NTSC_AUDIO_CARRIER 4500
-#define PAL_AUDIO_CARRIER_I 6000
-#define PAL_AUDIO_CARRIER_BGHN 5500
-#define PAL_AUDIO_CARRIER_MN 4500
-#define PAL_AUDIO_CARRIER_D 6500
-#define SEACAM_AUDIO_DKK1L 6500
-#define SEACAM_AUDIO_BG 5500
+#define NTSC_AUDIO_CARRIER 4500
+#define PAL_AUDIO_CARRIER_I 6000
+#define PAL_AUDIO_CARRIER_BGHN 5500
+#define PAL_AUDIO_CARRIER_MN 4500
+#define PAL_AUDIO_CARRIER_D 6500
+#define SEACAM_AUDIO_DKK1L 6500
+#define SEACAM_AUDIO_BG 5500
/* NICAM 728 32-kHz, 14-bit digital stereo audio is transmitted in 1ms frames
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
@@ -41,69 +41,69 @@
companeded audio data is interleaved to reduce the influence of dropouts
and the whole frame except for sync bits is scrambled for spectrum shaping.
Data is modulated using QPSK, at below following subcarrier freqs */
-#define NICAM728_PAL_BGH 5850
-#define NICAM728_PAL_I 6552
+#define NICAM728_PAL_BGH 5850
+#define NICAM728_PAL_I 6552
/* COMPREHENSIVE LIST OF FORMAT BY COUNTRY
(M) NTSC used in:
- Antigua, Aruba, Bahamas, Barbados, Belize, Bermuda, Bolivia, Burma,
- Canada, Chile, Colombia, Costa Rica, Cuba, Curacao, Dominican Republic,
- Ecuador, El Salvador, Guam Guatemala, Honduras, Jamaica, Japan,
- South Korea, Mexico, Montserrat, Myanmar, Nicaragua, Panama, Peru,
- Philippines, Puerto Rico, St Christopher and Nevis, Samoa, Suriname,
- Taiwan, Trinidad/Tobago, United States, Venezuela, Virgin Islands
+ Antigua, Aruba, Bahamas, Barbados, Belize, Bermuda, Bolivia, Burma,
+ Canada, Chile, Colombia, Costa Rica, Cuba, Curacao, Dominican Republic,
+ Ecuador, El Salvador, Guam Guatemala, Honduras, Jamaica, Japan,
+ South Korea, Mexico, Montserrat, Myanmar, Nicaragua, Panama, Peru,
+ Philippines, Puerto Rico, St Christopher and Nevis, Samoa, Suriname,
+ Taiwan, Trinidad/Tobago, United States, Venezuela, Virgin Islands
(B) PAL used in:
- Albania, Algeria, Australia, Austria, Bahrain, Bangladesh, Belgium,
- Bosnia-Herzegovinia, Brunei Darussalam, Cambodia, Cameroon, Croatia,
- Cyprus, Denmark, Egypt, Ethiopia, Equatorial Guinea, Finland, Germany,
- Ghana, Gibraltar, Greenland, Iceland, India, Indonesia, Israel, Italy,
- Jordan, Kenya, Kuwait, Liberia, Libya, Luxembourg, Malaysa, Maldives,
- Malta, Nepal, Netherlands, New Zeland, Nigeria, Norway, Oman, Pakistan,
- Papua New Guinea, Portugal, Qatar, Sao Tome and Principe, Saudi Arabia,
- Seychelles, Sierra Leone, Singapore, Slovenia, Somali, Spain,
- Sri Lanka, Sudan, Swaziland, Sweden, Switzeland, Syria, Thailand,
- Tunisia, Turkey, Uganda, United Arab Emirates, Yemen
+ Albania, Algeria, Australia, Austria, Bahrain, Bangladesh, Belgium,
+ Bosnia-Herzegovinia, Brunei Darussalam, Cambodia, Cameroon, Croatia,
+ Cyprus, Denmark, Egypt, Ethiopia, Equatorial Guinea, Finland, Germany,
+ Ghana, Gibraltar, Greenland, Iceland, India, Indonesia, Israel, Italy,
+ Jordan, Kenya, Kuwait, Liberia, Libya, Luxembourg, Malaysa, Maldives,
+ Malta, Nepal, Netherlands, New Zeland, Nigeria, Norway, Oman, Pakistan,
+ Papua New Guinea, Portugal, Qatar, Sao Tome and Principe, Saudi Arabia,
+ Seychelles, Sierra Leone, Singapore, Slovenia, Somali, Spain,
+ Sri Lanka, Sudan, Swaziland, Sweden, Switzeland, Syria, Thailand,
+ Tunisia, Turkey, Uganda, United Arab Emirates, Yemen
(N) PAL used in: (Combination N = 4.5MHz audio carrier, 3.58MHz burst)
- Argentina (Combination N), Paraguay, Uruguay
+ Argentina (Combination N), Paraguay, Uruguay
(M) PAL (525/60, 3.57MHz burst) used in:
- Brazil
+ Brazil
(G) PAL used in:
- Albania, Algeria, Austria, Bahrain, Bosnia/Herzegovinia, Cambodia,
- Cameroon, Croatia, Cyprus, Denmark, Egypt, Ethiopia, Equatorial Guinea,
- Finland, Germany, Gibraltar, Greenland, Iceland, Israel, Italy, Jordan,
- Kenya, Kuwait, Liberia, Libya, Luxembourg, Malaysia, Monaco,
- Mozambique, Netherlands, New Zealand, Norway, Oman, Pakistan,
- Papa New Guinea, Portugal, Qatar, Romania, Sierra Leone, Singapore,
- Slovenia, Somalia, Spain, Sri Lanka, Sudan, Swaziland, Sweeden,
- Switzerland, Syria, Thailand, Tunisia, Turkey, United Arab Emirates,
- Yemen, Zambia, Zimbabwe
+ Albania, Algeria, Austria, Bahrain, Bosnia/Herzegovinia, Cambodia,
+ Cameroon, Croatia, Cyprus, Denmark, Egypt, Ethiopia, Equatorial Guinea,
+ Finland, Germany, Gibraltar, Greenland, Iceland, Israel, Italy, Jordan,
+ Kenya, Kuwait, Liberia, Libya, Luxembourg, Malaysia, Monaco,
+ Mozambique, Netherlands, New Zealand, Norway, Oman, Pakistan,
+ Papa New Guinea, Portugal, Qatar, Romania, Sierra Leone, Singapore,
+ Slovenia, Somalia, Spain, Sri Lanka, Sudan, Swaziland, Sweeden,
+ Switzerland, Syria, Thailand, Tunisia, Turkey, United Arab Emirates,
+ Yemen, Zambia, Zimbabwe
(D) PAL used in:
- China, North Korea, Romania, Czech Republic
+ China, North Korea, Romania, Czech Republic
(H) PAL used in:
- Belgium
+ Belgium
(I) PAL used in:
- Angola, Botswana, Gambia, Guinea-Bissau, Hong Kong, Ireland, Lesotho,
- Malawi, Nambia, Nigeria, South Africa, Tanzania, United Kingdom,
- Zanzibar
+ Angola, Botswana, Gambia, Guinea-Bissau, Hong Kong, Ireland, Lesotho,
+ Malawi, Nambia, Nigeria, South Africa, Tanzania, United Kingdom,
+ Zanzibar
(B) SECAM used in:
- Djibouti, Greece, Iran, Iraq, Lebanon, Mali, Mauritania, Mauritus,
- Morocco
+ Djibouti, Greece, Iran, Iraq, Lebanon, Mali, Mauritania, Mauritus,
+ Morocco
(D) SECAM used in:
- Afghanistan, Armenia, Azerbaijan, Belarus, Bulgaria,
- Estonia, Georgia, Hungary, Zazakhstan, Lithuania, Mongolia, Moldova,
- Russia, Slovak Republic, Ukraine, Vietnam
+ Afghanistan, Armenia, Azerbaijan, Belarus, Bulgaria,
+ Estonia, Georgia, Hungary, Zazakhstan, Lithuania, Mongolia, Moldova,
+ Russia, Slovak Republic, Ukraine, Vietnam
(G) SECAM used in:
- Greecem Iran, Iraq, Mali, Mauritus, Morocco, Saudi Arabia
+ Greecem Iran, Iraq, Mali, Mauritus, Morocco, Saudi Arabia
(K) SECAM used in:
- Armenia, Azerbaijan, Bulgaria, Estonia, Georgia,
- Hungary, Kazakhstan, Lithuania, Madagascar, Moldova, Poland, Russia,
- Slovak Republic, Ukraine, Vietnam
+ Armenia, Azerbaijan, Bulgaria, Estonia, Georgia,
+ Hungary, Kazakhstan, Lithuania, Madagascar, Moldova, Poland, Russia,
+ Slovak Republic, Ukraine, Vietnam
(K1) SECAM used in:
- Benin, Burkina Faso, Burundi, Chad, Cape Verde, Central African
- Republic, Comoros, Congo, Gabon, Madagascar, Niger, Rwanda, Senegal,
- Togo, Zaire
+ Benin, Burkina Faso, Burundi, Chad, Cape Verde, Central African
+ Republic, Comoros, Congo, Gabon, Madagascar, Niger, Rwanda, Senegal,
+ Togo, Zaire
(L) SECAM used in:
- France
+ France
*/
/* --------------------------------------------------------------------- */
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index fb247753d7..ba40c3afc3 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -63,7 +63,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
static dvb_priv_t stream_defaults = {
- .cfg_prog = "",
+ .cfg_prog = "",
.cfg_card = 1,
.cfg_timeout = 30,
};
@@ -78,11 +78,11 @@ static const m_option_t stream_params[] = {
};
const m_option_t dvbin_opts_conf[] = {
- {"prog", &stream_defaults.cfg_prog, CONF_TYPE_STRING, 0, 0 ,0, NULL},
- {"card", &stream_defaults.cfg_card, CONF_TYPE_INT, M_OPT_RANGE, 1, 4, NULL},
- {"timeout", &stream_defaults.cfg_timeout, CONF_TYPE_INT, M_OPT_RANGE, 1, 30, NULL},
+ {"prog", &stream_defaults.cfg_prog, CONF_TYPE_STRING, 0, 0 ,0, NULL},
+ {"card", &stream_defaults.cfg_card, CONF_TYPE_INT, M_OPT_RANGE, 1, 4, NULL},
+ {"timeout", &stream_defaults.cfg_timeout, CONF_TYPE_INT, M_OPT_RANGE, 1, 30, NULL},
- {NULL, NULL, 0, 0, 0, 0, NULL}
+ {NULL, NULL, 0, 0, 0, 0, NULL}
};
@@ -90,469 +90,469 @@ const m_option_t dvbin_opts_conf[] = {
static dvb_channels_list *dvb_get_channels(struct mp_log *log, char *filename, int type)
{
- dvb_channels_list *list;
- FILE *f;
- char line[CHANNEL_LINE_LEN], *colon;
+ dvb_channels_list *list;
+ FILE *f;
+ char line[CHANNEL_LINE_LEN], *colon;
if (!filename)
return NULL;
- int fields, cnt, pcnt, k;
- int has8192, has0;
- dvb_channel_t *ptr, *tmp, chn;
- char tmp_lcr[256], tmp_hier[256], inv[256], bw[256], cr[256], mod[256], transm[256], gi[256], vpid_str[256], apid_str[256];
- const char *cbl_conf = "%d:%255[^:]:%d:%255[^:]:%255[^:]:%255[^:]:%255[^:]\n";
- 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_verbose(log, "CONFIG_READ FILE: %s, type: %d\n", filename, type);
- if((f=fopen(filename, "r"))==NULL)
- {
- mp_fatal(log, "CAN'T READ CONFIG FILE %s\n", filename);
- return NULL;
- }
-
- list = malloc(sizeof(dvb_channels_list));
- if(list == NULL)
- {
- fclose(f);
- mp_verbose(log, "DVB_GET_CHANNELS: couldn't malloc enough memory\n");
- return NULL;
- }
-
- ptr = &chn;
- list->NUM_CHANNELS = 0;
- list->channels = NULL;
- while(! feof(f))
- {
- if( fgets(line, CHANNEL_LINE_LEN, f) == NULL )
- continue;
-
- if((line[0] == '#') || (strlen(line) == 0))
- continue;
-
- colon = strchr(line, ':');
- if(colon)
- {
- k = colon - line;
- if(!k)
- continue;
- ptr->name = malloc(k+1);
- if(! ptr->name)
- continue;
- av_strlcpy(ptr->name, line, k+1);
- }
- else
- continue;
- k++;
- apid_str[0] = vpid_str[0] = 0;
- ptr->pids_cnt = 0;
- ptr->freq = 0;
- if(type == TUNER_TER)
- {
- fields = sscanf(&line[k], ter_conf,
- &ptr->freq, inv, bw, cr, tmp_lcr, mod,
- transm, gi, tmp_hier, vpid_str, apid_str);
- mp_verbose(log, "TER, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d",
- list->NUM_CHANNELS, fields, ptr->name, ptr->freq);
- }
- else if(type == TUNER_CBL)
- {
- fields = sscanf(&line[k], cbl_conf,
- &ptr->freq, inv, &ptr->srate,
- cr, mod, vpid_str, apid_str);
- mp_verbose(log, "CBL, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d",
- list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate);
- }
+ int fields, cnt, pcnt, k;
+ int has8192, has0;
+ dvb_channel_t *ptr, *tmp, chn;
+ char tmp_lcr[256], tmp_hier[256], inv[256], bw[256], cr[256], mod[256], transm[256], gi[256], vpid_str[256], apid_str[256];
+ const char *cbl_conf = "%d:%255[^:]:%d:%255[^:]:%255[^:]:%255[^:]:%255[^:]\n";
+ 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_verbose(log, "CONFIG_READ FILE: %s, type: %d\n", filename, type);
+ if((f=fopen(filename, "r"))==NULL)
+ {
+ mp_fatal(log, "CAN'T READ CONFIG FILE %s\n", filename);
+ return NULL;
+ }
+
+ list = malloc(sizeof(dvb_channels_list));
+ if(list == NULL)
+ {
+ fclose(f);
+ mp_verbose(log, "DVB_GET_CHANNELS: couldn't malloc enough memory\n");
+ return NULL;
+ }
+
+ ptr = &chn;
+ list->NUM_CHANNELS = 0;
+ list->channels = NULL;
+ while(! feof(f))
+ {
+ if( fgets(line, CHANNEL_LINE_LEN, f) == NULL )
+ continue;
+
+ if((line[0] == '#') || (strlen(line) == 0))
+ continue;
+
+ colon = strchr(line, ':');
+ if(colon)
+ {
+ k = colon - line;
+ if(!k)
+ continue;
+ ptr->name = malloc(k+1);
+ if(! ptr->name)
+ continue;
+ av_strlcpy(ptr->name, line, k+1);
+ }
+ else
+ continue;
+ k++;
+ apid_str[0] = vpid_str[0] = 0;
+ ptr->pids_cnt = 0;
+ ptr->freq = 0;
+ if(type == TUNER_TER)
+ {
+ fields = sscanf(&line[k], ter_conf,
+ &ptr->freq, inv, bw, cr, tmp_lcr, mod,
+ transm, gi, tmp_hier, vpid_str, apid_str);
+ mp_verbose(log, "TER, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d",
+ list->NUM_CHANNELS, fields, ptr->name, ptr->freq);
+ }
+ else if(type == TUNER_CBL)
+ {
+ fields = sscanf(&line[k], cbl_conf,
+ &ptr->freq, inv, &ptr->srate,
+ cr, mod, vpid_str, apid_str);
+ mp_verbose(log, "CBL, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d",
+ list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate);
+ }
#ifdef DVB_ATSC
- else if(type == TUNER_ATSC)
- {
- fields = sscanf(&line[k], atsc_conf,
- &ptr->freq, mod, vpid_str, apid_str);
- mp_verbose(log, "ATSC, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d\n",
- list->NUM_CHANNELS, fields, ptr->name, ptr->freq);
- }
+ else if(type == TUNER_ATSC)
+ {
+ fields = sscanf(&line[k], atsc_conf,
+ &ptr->freq, mod, vpid_str, apid_str);
+ mp_verbose(log, "ATSC, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d\n",
+ list->NUM_CHANNELS, fields, ptr->name, ptr->freq);
+ }
#endif
- else //SATELLITE
- {
- fields = sscanf(&line[k], sat_conf,
- &ptr->freq, &ptr->pol, &ptr->diseqc, &ptr->srate, vpid_str, apid_str);
- ptr->pol = toupper(ptr->pol);
- ptr->freq *= 1000UL;
- ptr->srate *= 1000UL;
- ptr->tone = -1;
- ptr->inv = INVERSION_AUTO;
- ptr->cr = FEC_AUTO;
- if((ptr->diseqc > 4) || (ptr->diseqc < 0))
- continue;
- if(ptr->diseqc > 0)
- ptr->diseqc--;
- mp_verbose(log, "SAT, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d",
- list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc);
- }
-
- if(vpid_str[0])
- {
- pcnt = sscanf(vpid_str, "%d+%d+%d+%d+%d+%d+%d", &ptr->pids[0], &ptr->pids[1], &ptr->pids[2], &ptr->pids[3],
- &ptr->pids[4], &ptr->pids[5], &ptr->pids[6]);
- if(pcnt > 0)
- {
- ptr->pids_cnt = pcnt;
- fields++;
- }
- }
-
- if(apid_str[0])
- {
- cnt = ptr->pids_cnt;
- pcnt = sscanf(apid_str, "%d+%d+%d+%d+%d+%d+%d+%d", &ptr->pids[cnt], &ptr->pids[cnt+1], &ptr->pids[cnt+2],
- &ptr->pids[cnt+3], &ptr->pids[cnt+4], &ptr->pids[cnt+5], &ptr->pids[cnt+6], &ptr->pids[cnt+7]);
- if(pcnt > 0)
- {
- ptr->pids_cnt += pcnt;
- fields++;
- }
- }
-
- if((fields < 2) || (ptr->pids_cnt <= 0) || (ptr->freq == 0) || (strlen(ptr->name) == 0))
- continue;
-
- has8192 = has0 = 0;
- for(cnt = 0; cnt < ptr->pids_cnt; cnt++)
- {
- if(ptr->pids[cnt] == 8192)
- has8192 = 1;
- if(ptr->pids[cnt] == 0)
- has0 = 1;
- }
- if(has8192)
- {
- ptr->pids[0] = 8192;
- ptr->pids_cnt = 1;
- }
- else if(! has0)
- {
- ptr->pids[ptr->pids_cnt] = 0; //PID 0 is the PAT
- ptr->pids_cnt++;
- }
- mp_verbose(log, " PIDS: ");
- for(cnt = 0; cnt < ptr->pids_cnt; cnt++)
- mp_verbose(log, " %d ", ptr->pids[cnt]);
- mp_verbose(log, "\n");
-
- if((type == TUNER_TER) || (type == TUNER_CBL))
- {
- if(! strcmp(inv, "INVERSION_ON"))
- ptr->inv = INVERSION_ON;
- else if(! strcmp(inv, "INVERSION_OFF"))
- ptr->inv = INVERSION_OFF;
- else
- ptr->inv = INVERSION_AUTO;
-
-
- if(! strcmp(cr, "FEC_1_2"))
- ptr->cr =FEC_1_2;
- else if(! strcmp(cr, "FEC_2_3"))
- ptr->cr =FEC_2_3;
- else if(! strcmp(cr, "FEC_3_4"))
- ptr->cr =FEC_3_4;
- else if(! strcmp(cr, "FEC_4_5"))
- ptr->cr =FEC_4_5;
- else if(! strcmp(cr, "FEC_6_7"))
- ptr->cr =FEC_6_7;
- else if(! strcmp(cr, "FEC_8_9"))
- ptr->cr =FEC_8_9;
- else if(! strcmp(cr, "FEC_5_6"))
- ptr->cr =FEC_5_6;
- else if(! strcmp(cr, "FEC_7_8"))
- ptr->cr =FEC_7_8;
- else if(! strcmp(cr, "FEC_NONE"))
- ptr->cr =FEC_NONE;
- else ptr->cr =FEC_AUTO;
- }
-
-
- if((type == TUNER_TER) || (type == TUNER_CBL) || (type == TUNER_ATSC))
- {
- if(! strcmp(mod, "QAM_128"))
- ptr->mod = QAM_128;
- else if(! strcmp(mod, "QAM_256"))
- ptr->mod = QAM_256;
- else if(! strcmp(mod, "QAM_64"))
- ptr->mod = QAM_64;
- else if(! strcmp(mod, "QAM_32"))
- ptr->mod = QAM_32;
- else if(! strcmp(mod, "QAM_16"))
- ptr->mod = QAM_16;
+ else //SATELLITE
+ {
+ fields = sscanf(&line[k], sat_conf,
+ &ptr->freq, &ptr->pol, &ptr->diseqc, &ptr->srate, vpid_str, apid_str);
+ ptr->pol = toupper(ptr->pol);
+ ptr->freq *= 1000UL;
+ ptr->srate *= 1000UL;
+ ptr->tone = -1;
+ ptr->inv = INVERSION_AUTO;
+ ptr->cr = FEC_AUTO;
+ if((ptr->diseqc > 4) || (ptr->diseqc < 0))
+ continue;
+ if(ptr->diseqc > 0)
+ ptr->diseqc--;
+ mp_verbose(log, "SAT, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d",
+ list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc);
+ }
+
+ if(vpid_str[0])
+ {
+ pcnt = sscanf(vpid_str, "%d+%d+%d+%d+%d+%d+%d", &ptr->pids[0], &ptr->pids[1], &ptr->pids[2], &ptr->pids[3],
+ &ptr->pids[4], &ptr->pids[5], &ptr->pids[6]);
+ if(pcnt > 0)
+ {
+ ptr->pids_cnt = pcnt;
+ fields++;
+ }
+ }
+
+ if(apid_str[0])
+ {
+ cnt = ptr->pids_cnt;
+ pcnt = sscanf(apid_str, "%d+%d+%d+%d+%d+%d+%d+%d", &ptr->pids[cnt], &ptr->pids[cnt+1], &ptr->pids[cnt+2],
+ &ptr->pids[cnt+3], &ptr->pids[cnt+4], &ptr->pids[cnt+5], &ptr->pids[cnt+6], &ptr->pids[cnt+7]);
+ if(pcnt > 0)
+ {
+ ptr->pids_cnt += pcnt;
+ fields++;
+ }
+ }
+
+ if((fields < 2) || (ptr->pids_cnt <= 0) || (ptr->freq == 0) || (strlen(ptr->name) == 0))
+ continue;
+
+ has8192 = has0 = 0;
+ for(cnt = 0; cnt < ptr->pids_cnt; cnt++)
+ {
+ if(ptr->pids[cnt] == 8192)
+ has8192 = 1;
+ if(ptr->pids[cnt] == 0)
+ has0 = 1;
+ }
+ if(has8192)
+ {
+ ptr->pids[0] = 8192;
+ ptr->pids_cnt = 1;
+ }
+ else if(! has0)
+ {
+ ptr->pids[ptr->pids_cnt] = 0; //PID 0 is the PAT
+ ptr->pids_cnt++;
+ }
+ mp_verbose(log, " PIDS: ");
+ for(cnt = 0; cnt < ptr->pids_cnt; cnt++)
+ mp_verbose(log, " %d ", ptr->pids[cnt]);
+ mp_verbose(log, "\n");
+
+ if((type == TUNER_TER) || (type == TUNER_CBL))
+ {
+ if(! strcmp(inv, "INVERSION_ON"))
+ ptr->inv = INVERSION_ON;
+ else if(! strcmp(inv, "INVERSION_OFF"))
+ ptr->inv = INVERSION_OFF;
+ else
+ ptr->inv = INVERSION_AUTO;
+
+
+ if(! strcmp(cr, "FEC_1_2"))
+ ptr->cr =FEC_1_2;
+ else if(! strcmp(cr, "FEC_2_3"))
+ ptr->cr =FEC_2_3;
+ else if(! strcmp(cr, "FEC_3_4"))
+ ptr->cr =FEC_3_4;
+ else if(! strcmp(cr, "FEC_4_5"))
+ ptr->cr =FEC_4_5;
+ else if(! strcmp(cr, "FEC_6_7"))
+ ptr->cr =FEC_6_7;
+ else if(! strcmp(cr, "FEC_8_9"))
+ ptr->cr =FEC_8_9;
+ else if(! strcmp(cr, "FEC_5_6"))
+ ptr->cr =FEC_5_6;
+ else if(! strcmp(cr, "FEC_7_8"))
+ ptr->cr =FEC_7_8;
+ else if(! strcmp(cr, "FEC_NONE"))
+ ptr->cr =FEC_NONE;
+ else ptr->cr =FEC_AUTO;
+ }
+
+
+ if((type == TUNER_TER) || (type == TUNER_CBL) || (type == TUNER_ATSC))
+ {
+ if(! strcmp(mod, "QAM_128"))
+ ptr->mod = QAM_128;
+ else if(! strcmp(mod, "QAM_256"))
+ ptr->mod = QAM_256;
+ else if(! strcmp(mod, "QAM_64"))
+ ptr->mod = QAM_64;
+ else if(! strcmp(mod, "QAM_32"))
+ ptr->mod = QAM_32;
+ else if(! strcmp(mod, "QAM_16"))
+ ptr->mod = QAM_16;
#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"))
- ptr->mod = VSB_16;
- else if(! strcmp(mod, "QAM_AUTO"))
- ptr->mod = QAM_AUTO;
+ else if(! strcmp(mod, "VSB_8") || ! strcmp(mod, "8VSB"))
+ ptr->mod = VSB_8;
+ else if(! strcmp(mod, "VSB_16") || !strcmp(mod, "16VSB"))
+ ptr->mod = VSB_16;
+ else if(! strcmp(mod, "QAM_AUTO"))
+ ptr->mod = QAM_AUTO;
#endif
- }
-
- if(type == TUNER_TER)
- {
- if(! strcmp(bw, "BANDWIDTH_6_MHZ"))
- ptr->bw = BANDWIDTH_6_MHZ;
- else if(! strcmp(bw, "BANDWIDTH_7_MHZ"))
- ptr->bw = BANDWIDTH_7_MHZ;
- else if(! strcmp(bw, "BANDWIDTH_8_MHZ"))
- ptr->bw = BANDWIDTH_8_MHZ;
-
-
- if(! strcmp(transm, "TRANSMISSION_MODE_2K"))
- ptr->trans = TRANSMISSION_MODE_2K;
- else if(! strcmp(transm, "TRANSMISSION_MODE_8K"))
- ptr->trans = TRANSMISSION_MODE_8K;
- else if(! strcmp(transm, "TRANSMISSION_MODE_AUTO"))
- ptr->trans = TRANSMISSION_MODE_AUTO;
-
- if(! strcmp(gi, "GUARD_INTERVAL_1_32"))
- ptr->gi = GUARD_INTERVAL_1_32;
- else if(! strcmp(gi, "GUARD_INTERVAL_1_16"))
- ptr->gi = GUARD_INTERVAL_1_16;
- else if(! strcmp(gi, "GUARD_INTERVAL_1_8"))
- ptr->gi = GUARD_INTERVAL_1_8;
- else if(! strcmp(gi, "GUARD_INTERVAL_1_4"))
- ptr->gi = GUARD_INTERVAL_1_4;
- else ptr->gi = GUARD_INTERVAL_AUTO;
-
- if(! strcmp(tmp_lcr, "FEC_1_2"))
- ptr->cr_lp =FEC_1_2;
- else if(! strcmp(tmp_lcr, "FEC_2_3"))
- ptr->cr_lp =FEC_2_3;
- else if(! strcmp(tmp_lcr, "FEC_3_4"))
- ptr->cr_lp =FEC_3_4;
- else if(! strcmp(tmp_lcr, "FEC_4_5"))
- ptr->cr_lp =FEC_4_5;
- else if(! strcmp(tmp_lcr, "FEC_6_7"))
- ptr->cr_lp =FEC_6_7;
- else if(! strcmp(tmp_lcr, "FEC_8_9"))
- ptr->cr_lp =FEC_8_9;
- else if(! strcmp(tmp_lcr, "FEC_5_6"))
- ptr->cr_lp =FEC_5_6;
- else if(! strcmp(tmp_lcr, "FEC_7_8"))
- ptr->cr_lp =FEC_7_8;
- 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"))
- ptr->hier = HIERARCHY_2;
- else if(! strcmp(tmp_hier, "HIERARCHY_4"))
- ptr->hier = HIERARCHY_4;
- else if(! strcmp(tmp_hier, "HIERARCHY_AUTO"))
- ptr->hier = HIERARCHY_AUTO;
- else ptr->hier = HIERARCHY_NONE;
- }
-
- tmp = realloc(list->channels, sizeof(dvb_channel_t) * (list->NUM_CHANNELS + 1));
- if(tmp == NULL)
- break;
-
- list->channels = tmp;
- memcpy(&(list->channels[list->NUM_CHANNELS]), ptr, sizeof(dvb_channel_t));
- list->NUM_CHANNELS++;
- if(sizeof(dvb_channel_t) * list->NUM_CHANNELS >= 1024*1024)
- {
- mp_verbose(log, "dvbin.c, > 1MB allocated for channels struct, dropping the rest of the file\r\n");
- break;
- }
- }
-
- fclose(f);
- if(list->NUM_CHANNELS == 0)
- {
- free(list->channels);
- free(list);
- return NULL;
- }
-
- list->current = 0;
- return list;
+ }
+
+ if(type == TUNER_TER)
+ {
+ if(! strcmp(bw, "BANDWIDTH_6_MHZ"))
+ ptr->bw = BANDWIDTH_6_MHZ;
+ else if(! strcmp(bw, "BANDWIDTH_7_MHZ"))
+ ptr->bw = BANDWIDTH_7_MHZ;
+ else if(! strcmp(bw, "BANDWIDTH_8_MHZ"))
+ ptr->bw = BANDWIDTH_8_MHZ;
+
+
+ if(! strcmp(transm, "TRANSMISSION_MODE_2K"))
+ ptr->trans = TRANSMISSION_MODE_2K;
+ else if(! strcmp(transm, "TRANSMISSION_MODE_8K"))
+ ptr->trans = TRANSMISSION_MODE_8K;
+ else if(! strcmp(transm, "TRANSMISSION_MODE_AUTO"))
+ ptr->trans = TRANSMISSION_MODE_AUTO;
+
+ if(! strcmp(gi, "GUARD_INTERVAL_1_32"))
+ ptr->gi = GUARD_INTERVAL_1_32;
+ else if(! strcmp(gi, "GUARD_INTERVAL_1_16"))
+ ptr->gi = GUARD_INTERVAL_1_16;
+ else if(! strcmp(gi, "GUARD_INTERVAL_1_8"))
+ ptr->gi = GUARD_INTERVAL_1_8;
+ else if(! strcmp(gi, "GUARD_INTERVAL_1_4"))
+ ptr->gi = GUARD_INTERVAL_1_4;
+ else ptr->gi = GUARD_INTERVAL_AUTO;
+
+ if(! strcmp(tmp_lcr, "FEC_1_2"))
+ ptr->cr_lp =FEC_1_2;
+ else if(! strcmp(tmp_lcr, "FEC_2_3"))
+ ptr->cr_lp =FEC_2_3;
+ else if(! strcmp(tmp_lcr, "FEC_3_4"))
+ ptr->cr_lp =FEC_3_4;
+ else if(! strcmp(tmp_lcr, "FEC_4_5"))
+ ptr->cr_lp =FEC_4_5;
+ else if(! strcmp(tmp_lcr, "FEC_6_7"))
+ ptr->cr_lp =FEC_6_7;
+ else if(! strcmp(tmp_lcr, "FEC_8_9"))
+ ptr->cr_lp =FEC_8_9;
+ else if(! strcmp(tmp_lcr, "FEC_5_6"))
+ ptr->cr_lp =FEC_5_6;
+ else if(! strcmp(tmp_lcr, "FEC_7_8"))
+ ptr->cr_lp =FEC_7_8;
+ 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"))
+ ptr->hier = HIERARCHY_2;
+ else if(! strcmp(tmp_hier, "HIERARCHY_4"))
+ ptr->hier = HIERARCHY_4;
+ else if(! strcmp(tmp_hier, "HIERARCHY_AUTO"))
+ ptr->hier = HIERARCHY_AUTO;
+ else ptr->hier = HIERARCHY_NONE;
+ }
+
+ tmp = realloc(list->channels, sizeof(dvb_channel_t) * (list->NUM_CHANNELS + 1));
+ if(tmp == NULL)
+ break;
+
+ list->channels = tmp;
+ memcpy(&(list->channels[list->NUM_CHANNELS]), ptr, sizeof(dvb_channel_t));
+ list->NUM_CHANNELS++;
+ if(sizeof(dvb_channel_t) * list->NUM_CHANNELS >= 1024*1024)
+ {
+ mp_verbose(log, "dvbin.c, > 1MB allocated for channels struct, dropping the rest of the file\r\n");
+ break;
+ }
+ }
+
+ fclose(f);
+ if(list->NUM_CHANNELS == 0)
+ {
+ free(list->channels);
+ free(list);
+ return NULL;
+ }
+
+ list->current = 0;
+ return list;
}
void dvb_free_config(dvb_config_t *config)
{
- int i, j;
-
- for(i=0; i<config->count; i++)
- {
- free(config->cards[i].name);
- if(!config->cards[i].list)
- continue;
- if(config->cards[i].list->channels)
- {
- for(j=0; j<config->cards[i].list->NUM_CHANNELS; j++)
- free(config->cards[i].list->channels[j].name);
- free(config->cards[i].list->channels);
- }
- free(config->cards[i].list);
- }
- free(config);
+ int i, j;
+
+ for(i=0; i<config->count; i++)
+ {
+ free(config->cards[i].name);
+ if(!config->cards[i].list)
+ continue;
+ if(config->cards[i].list->channels)
+ {
+ for(j=0; j<config->cards[i].list->NUM_CHANNELS; j++)
+ free(config->cards[i].list->channels[j].name);
+ free(config->cards[i].list->channels);
+ }
+ free(config->cards[i].list);
+ }
+ free(config);
}
static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
{
- struct pollfd pfds[1];
- int pos=0, tries, rk, fd;
- dvb_priv_t *priv = (dvb_priv_t *) stream->priv;
-
- MP_TRACE(stream, "dvb_streaming_read(%d)\n", size);
-
- tries = priv->retry + 1;
-
- fd = priv->fd;
- while(pos < size)
- {
- pfds[0].fd = fd;
- pfds[0].events = POLLIN | POLLPRI;
-
- rk = size - pos;
- if(poll(pfds, 1, 500) <= 0)
- {
- MP_ERR(stream, "dvb_streaming_read, attempt N. %d failed with errno %d when reading %d bytes\n", tries, errno, size-pos);
- errno = 0;
- if(--tries > 0)
- continue;
- else
- break;
- }
- if((rk = read(fd, &buffer[pos], rk)) > 0)
- {
- pos += rk;
- MP_TRACE(stream, "ret (%d) bytes\n", pos);
- }
- }
-
-
- if(! pos)
- MP_ERR(stream, "dvb_streaming_read, return %d bytes\n", pos);
-
- return pos;
+ struct pollfd pfds[1];
+ int pos=0, tries, rk, fd;
+ dvb_priv_t *priv = (dvb_priv_t *) stream->priv;
+
+ MP_TRACE(stream, "dvb_streaming_read(%d)\n", size);
+
+ tries = priv->retry + 1;
+
+ fd = priv->fd;
+ while(pos < size)
+ {
+ pfds[0].fd = fd;
+ pfds[0].events = POLLIN | POLLPRI;
+
+ rk = size - pos;
+ if(poll(pfds, 1, 500) <= 0)
+ {
+ MP_ERR(stream, "dvb_streaming_read, attempt N. %d failed with errno %d when reading %d bytes\n", tries, errno, size-pos);
+ errno = 0;
+ if(--tries > 0)
+ continue;
+ else
+ break;
+ }
+ if((rk = read(fd, &buffer[pos], rk)) > 0)
+ {
+ pos += rk;
+ MP_TRACE(stream, "ret (%d) bytes\n", pos);
+ }
+ }
+
+
+ if(! pos)
+ MP_ERR(stream, "dvb_streaming_read, return %d bytes\n", pos);
+
+ return pos;
}
static void dvbin_close(stream_t *stream);
int dvb_set_channel(stream_t *stream, int card, int n)
{
- dvb_channels_list *new_list;
- dvb_channel_t *channel;
- dvb_priv_t *priv = stream->priv;
- char buf[4096];
- dvb_config_t *conf = (dvb_config_t *) priv->config;
- int devno;
- int i;
-
- if((card < 0) || (card > conf->count))
- {
- MP_ERR(stream, "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))
- {
- MP_ERR(stream, "dvb_set_channel: INVALID CHANNEL NUMBER: %d, for card %d, abort\n", n, card);
- 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)
- {
- dvbin_close(stream);
- if(! dvb_open_devices(priv, devno, channel->pids_cnt))
- {
- MP_ERR(stream, "DVB_SET_CHANNEL, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
- return 0;
- }
- }
- 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;
- }
- }
- else
- {
- if(! dvb_open_devices(priv, devno, channel->pids_cnt))
- {
- MP_ERR(stream, "DVB_SET_CHANNEL2, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
- return 0;
- }
- }
-
- priv->card = card;
- priv->list = new_list;
- priv->retry = 5;
- new_list->current = n;
- priv->fd = priv->dvr_fd;
- MP_VERBOSE(stream, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
-
- stream->buf_pos = stream->buf_len = 0;
- stream->pos = 0;
-
- if(channel->freq != priv->last_freq)
- if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
- channel->inv, channel->mod, channel->gi, channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->cfg_timeout))
- return 0;
-
- priv->last_freq = channel->freq;
- priv->is_on = 1;
-
- //sets demux filters and restart the stream
- for(i = 0; i < channel->pids_cnt; i++)
- {
- if(! dvb_set_ts_filt(priv,priv->demux_fds[i], channel->pids[i], DMX_PES_OTHER))
- return 0;
- }
-
- return 1;
+ dvb_channels_list *new_list;
+ dvb_channel_t *channel;
+ dvb_priv_t *priv = stream->priv;
+ char buf[4096];
+ dvb_config_t *conf = (dvb_config_t *) priv->config;
+ int devno;
+ int i;
+
+ if((card < 0) || (card > conf->count))
+ {
+ MP_ERR(stream, "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))
+ {
+ MP_ERR(stream, "dvb_set_channel: INVALID CHANNEL NUMBER: %d, for card %d, abort\n", n, card);
+ 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)
+ {
+ dvbin_close(stream);
+ if(! dvb_open_devices(priv, devno, channel->pids_cnt))
+ {
+ MP_ERR(stream, "DVB_SET_CHANNEL, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
+ return 0;
+ }
+ }
+ 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;
+ }
+ }
+ else
+ {
+ if(! dvb_open_devices(priv, devno, channel->pids_cnt))
+ {
+ MP_ERR(stream, "DVB_SET_CHANNEL2, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
+ return 0;
+ }
+ }
+
+ priv->card = card;
+ priv->list = new_list;
+ priv->retry = 5;
+ new_list->current = n;
+ priv->fd = priv->dvr_fd;
+ MP_VERBOSE(stream, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
+
+ stream->buf_pos = stream->buf_len = 0;
+ stream->pos = 0;
+
+ if(channel->freq != priv->last_freq)
+ if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
+ channel->inv, channel->mod, channel->gi, channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->cfg_timeout))
+ return 0;
+
+ priv->last_freq = channel->freq;
+ priv->is_on = 1;
+
+ //sets demux filters and restart the stream
+ for(i = 0; i < channel->pids_cnt; i++)
+ {
+ if(! dvb_set_ts_filt(priv,priv->demux_fds[i], channel->pids[i], DMX_PES_OTHER))
+ return 0;
+ }
+
+ return 1;
}
int dvb_step_channel(stream_t *stream, int dir)
{
- int new_current;
- dvb_channels_list *list;
- dvb_priv_t *priv = stream->priv;
+ int new_current;
+ dvb_channels_list *list;
+ dvb_priv_t *priv = stream->priv;
- MP_VERBOSE(stream, "DVB_STEP_CHANNEL dir %d\n", dir);
+ MP_VERBOSE(stream, "DVB_STEP_CHANNEL dir %d\n", dir);
- if(priv == NULL)
- {
- MP_ERR(stream, "dvb_step_channel: NULL priv_ptr, quit\n");
- return 0;
- }
+ if(priv == NULL)
+ {
+ MP_ERR(stream, "dvb_step_channel: NULL priv_ptr, quit\n");
+ return 0;
+ }
- list = priv->list;
- if(list == NULL)
- {
- MP_ERR(stream, "dvb_step_channel: NULL list_ptr, quit\n");
- return 0;
- }
+ list = priv->list;
+ if(list == NULL)
+ {
+ MP_ERR(stream, "dvb_step_channel: NULL list_ptr, quit\n");
+ return 0;
+ }
- new_current = (list->NUM_CHANNELS + list->current + (dir == DVB_CHANNEL_HIGHER ? 1 : -1)) % list->NUM_CHANNELS;
+ new_current = (list->NUM_CHANNELS + list->current + (dir == DVB_CHANNEL_HIGHER ? 1 : -1)) % list->NUM_CHANNELS;
- return dvb_set_channel(stream, priv->card, new_current);
+ return dvb_set_channel(stream, priv->card, new_current);
}
@@ -560,68 +560,68 @@ int dvb_step_channel(stream_t *stream, int dir)
static void dvbin_close(stream_t *stream)
{
- int i;
- dvb_priv_t *priv = (dvb_priv_t *) stream->priv;
-
- for(i = priv->demux_fds_cnt-1; i >= 0; i--)
- {
- priv->demux_fds_cnt--;
- MP_VERBOSE(stream, "DVBIN_CLOSE, close(%d), fd=%d, COUNT=%d\n", i, priv->demux_fds[i], priv->demux_fds_cnt);
- close(priv->demux_fds[i]);
- }
- close(priv->dvr_fd);
-
- close(priv->fe_fd);
- priv->fe_fd = priv->sec_fd = priv->dvr_fd = -1;
-
- priv->is_on = 0;
- dvb_free_config(priv->config);
+ int i;
+ dvb_priv_t *priv = (dvb_priv_t *) stream->priv;
+
+ for(i = priv->demux_fds_cnt-1; i >= 0; i--)
+ {
+ priv->demux_fds_cnt--;
+ MP_VERBOSE(stream, "DVBIN_CLOSE, close(%d), fd=%d, COUNT=%d\n", i, priv->demux_fds[i], priv->demux_fds_cnt);
+ close(priv->demux_fds[i]);
+ }
+ close(priv->dvr_fd);
+
+ close(priv->fe_fd);
+ priv->fe_fd = priv->sec_fd = priv->dvr_fd = -1;
+
+ priv->is_on = 0;
+ dvb_free_config(priv->config);
}
static int dvb_streaming_start(stream_t *stream, int tuner_type, char *progname)
{
- int i;
- dvb_channel_t *channel = NULL;
- dvb_priv_t *priv = stream->priv;
+ int i;
+ dvb_channel_t *channel = NULL;
+ dvb_priv_t *priv = stream->priv;
dvb_priv_t *opts = priv;
- MP_VERBOSE(stream, "\r\ndvb_streaming_start(PROG: %s, CARD: %d)\r\n",
- opts->cfg_prog, opts->cfg_card);
+ MP_VERBOSE(stream, "\r\ndvb_streaming_start(PROG: %s, CARD: %d)\r\n",
+ opts->cfg_prog, opts->cfg_card);
- priv->is_on = 0;
+ priv->is_on = 0;
- i = 0;
- while((channel == NULL) && i < priv->list->NUM_CHANNELS)
- {
- if(! strcmp(priv->list->channels[i].name, progname))
- channel = &(priv->list->channels[i]);
+ i = 0;
+ while((channel == NULL) && i < priv->list->NUM_CHANNELS)
+ {
+ if(! strcmp(priv->list->channels[i].name, progname))
+ channel = &(priv->list->channels[i]);
- i++;
- }
+ i++;
+ }
- if(channel != NULL)
- {
- priv->list->current = i-1;
- MP_VERBOSE(stream, "PROGRAM NUMBER %d: name=%s, freq=%u\n", i-1, channel->name, channel->freq);
- }
- else
- {
- MP_ERR(stream, "\n\nDVBIN: no such channel \"%s\"\n\n", progname);
- return 0;
- }
+ if(channel != NULL)
+ {
+ priv->list->current = i-1;
+ MP_VERBOSE(stream, "PROGRAM NUMBER %d: name=%s, freq=%u\n", i-1, channel->name, channel->freq);
+ }
+ else
+ {
+ MP_ERR(stream, "\n\nDVBIN: no such channel \"%s\"\n\n", progname);
+ return 0;
+ }
- if(!dvb_set_channel(stream, priv->card, priv->list->current))
- {
- MP_ERR(stream, "ERROR, COULDN'T SET CHANNEL %i: ", priv->list->current);
- dvbin_close(stream);
- return 0;
- }
+ if(!dvb_set_channel(stream, priv->card, priv->list->current))
+ {
+ MP_ERR(stream, "ERROR, COULDN'T SET CHANNEL %i: ", priv->list->current);
+ dvbin_close(stream);
+ return 0;
+ }
- MP_VERBOSE(stream, "SUCCESSFUL EXIT from dvb_streaming_start\n");
+ MP_VERBOSE(stream, "SUCCESSFUL EXIT from dvb_streaming_start\n");
- return 1;
+ return 1;
}
@@ -629,78 +629,78 @@ static int dvb_streaming_start(stream_t *stream, int tuner_type, char *progname)
static int dvb_open(stream_t *stream, int mode)
{
- // I don't force the file format bacause, although it's almost always TS,
- // there are some providers that stream an IP multicast with M$ Mpeg4 inside
- dvb_priv_t *priv = stream->priv;
+ // I don't force the file format bacause, although it's almost always TS,
+ // there are some providers that stream an IP multicast with M$ Mpeg4 inside
+ dvb_priv_t *priv = stream->priv;
priv->log = stream->log;
dvb_priv_t *p = priv;
- char *progname;
- int tuner_type = 0, i;
+ char *progname;
+ int tuner_type = 0, i;
- if(mode != STREAM_READ)
- return STREAM_UNSUPPORTED;
+ if(mode != STREAM_READ)
+ return STREAM_UNSUPPORTED;
- priv->fe_fd = priv->sec_fd = priv->dvr_fd = -1;
- priv->config = dvb_get_config(stream);
- if(priv->config == NULL)
- {
- MP_ERR(stream, "DVB CONFIGURATION IS EMPTY, exit\n");
- return STREAM_ERROR;
- }
+ priv->fe_fd = priv->sec_fd = priv->dvr_fd = -1;
+ priv->config = dvb_get_config(stream);
+ if(priv->config == NULL)
+ {
+ MP_ERR(stream, "DVB CONFIGURATION IS EMPTY, exit\n");
+ return STREAM_ERROR;
+ }
- priv->card = -1;
- for(i=0; i<priv->config->count; i++)
- {
- if(priv->config->cards[i].devno+1 == p->cfg_card)
- {
- priv->card = i;
- break;
- }
- }
+ priv->card = -1;
+ for(i=0; i<priv->config->count; i++)
+ {
+ if(priv->config->cards[i].devno+1 == p->cfg_card)
+ {
+ priv->card = i;
+ break;
+ }
+ }
- if(priv->card == -1)
- {
- MP_ERR(stream, "NO CONFIGURATION FOUND FOR CARD N. %d, exit\n", p->cfg_card);
- return STREAM_ERROR;
- }
- priv->timeout = p->cfg_timeout;
+ if(priv->card == -1)
+ {
+ MP_ERR(stream, "NO CONFIGURATION FOUND FOR CARD N. %d, exit\n", p->cfg_card);
+ return STREAM_ERROR;
+ }
+ priv->timeout = p->cfg_timeout;
- tuner_type = priv->config->cards[priv->card].type;
+ tuner_type = priv->config->cards[priv->card].type;
- if(tuner_type == 0)
- {
- MP_VERBOSE(stream, "OPEN_DVB: UNKNOWN OR UNDETECTABLE TUNER TYPE, EXIT\n");
- return STREAM_ERROR;
- }
+ if(tuner_type == 0)
+ {
+ MP_VERBOSE(stream, "OPEN_DVB: UNKNOWN OR UNDETECTABLE TUNER TYPE, EXIT\n");
+ return STREAM_ERROR;
+ }
- priv->tuner_type = tuner_type;
+ priv->tuner_type = tuner_type;
- MP_VERBOSE(stream, "OPEN_DVB: prog=%s, card=%d, type=%d\n",
- p->cfg_prog, priv->card+1, priv->tuner_type);
+ MP_VERBOSE(stream, "OPEN_DVB: prog=%s, card=%d, type=%d\n",
+ p->cfg_prog, priv->card+1, priv->tuner_type);
- priv->list = priv->config->cards[priv->card].list;
+ priv->list = priv->config->cards[priv->card].list;
- if((! strcmp(p->cfg_prog, "")) && (priv->list != NULL))
- progname = priv->list->channels[0].name;
- else
- progname = p->cfg_prog;
+ if((! strcmp(p->cfg_prog, "")) && (priv->list != NULL))
+ progname = priv->list->channels[0].name;
+ else
+ progname = p->cfg_prog;
- if(! dvb_streaming_start(stream, tuner_type, progname))
- {
- return STREAM_ERROR;
- }
+ if(! dvb_streaming_start(stream, tuner_type, progname))
+ {
+ return STREAM_ERROR;
+ }
- stream->type = STREAMTYPE_DVB;
- stream->fill_buffer = dvb_streaming_read;
- stream->close = dvbin_close;
+ stream->type = STREAMTYPE_DVB;
+ stream->fill_buffer = dvb_streaming_read;
+ stream->close = dvbin_close;
- stream->demuxer = "lavf";
+ stream->demuxer = "lavf";
stream->lavf_type = "mpegts";
- return STREAM_OK;
+ return STREAM_OK;
}
#define MAX_CARDS 4
@@ -708,37 +708,37 @@ dvb_config_t *dvb_get_config(stream_t *stream)
{
struct mp_log *log = stream->log;
struct mpv_global *global = stream->global;
- int i, fd, type, size;
- char filename[30], *conf_file, *name;
- 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->count = 0;
- conf->cards = NULL;
- for(i=0; i<MAX_CARDS; i++)
- {
- snprintf(filename, sizeof(filename), "/dev/dvb/adapter%d/frontend0", i);
- fd = open(filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC);
- if(fd < 0)
- {
- mp_verbose(log, "DVB_CONFIG, can't open device %s, skipping\n", filename);
- continue;
- }
-
- type = dvb_get_tuner_type(fd, log);
- close(fd);
- if(type != TUNER_SAT && type != TUNER_TER && type != TUNER_CBL && type != TUNER_ATSC)
- {
- mp_verbose(log, "DVB_CONFIG, can't detect tuner type of card %d, skipping\n", i);
- continue;
- }
+ int i, fd, type, size;
+ char filename[30], *conf_file, *name;
+ 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->count = 0;
+ conf->cards = NULL;
+ for(i=0; i<MAX_CARDS; i++)
+ {
+ snprintf(filename, sizeof(filename), "/dev/dvb/adapter%d/frontend0", i);
+ fd = open(filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC);
+ if(fd < 0)
+ {
+ mp_verbose(log, "DVB_CONFIG, can't open device %s, skipping\n", filename);
+ continue;
+ }
+
+ type = dvb_get_tuner_type(fd, log);
+ close(fd);
+ if(type != TUNER_SAT && type != TUNER_TER && type != TUNER_CBL && type != TUNER_ATSC)
+ {
+ mp_verbose(log, "DVB_CONFIG, can't detect tuner type of card %d, skipping\n", i);
+ continue;
+ }
void *talloc_ctx = talloc_new(NULL);
conf_file = mp_find_user_config_file(talloc_ctx, global, "channels.conf");
@@ -768,42 +768,42 @@ dvb_config_t *dvb_get_config(stream_t *stream)
list = dvb_get_channels(log, conf_file, type);
talloc_free(talloc_ctx);
- if(list == NULL)
- continue;
-
- size = sizeof(dvb_card_config_t) * (conf->count + 1);
- tmp = realloc(conf->cards, size);
-
- if(tmp == NULL)
- {
- fprintf(stderr, "DVB_CONFIG, can't realloc %d bytes, skipping\n", size);
- continue;
- }
- cards = tmp;
-
- name = malloc(20);
- if(name==NULL)
- {
- fprintf(stderr, "DVB_CONFIG, can't realloc 20 bytes, skipping\n");
- continue;
- }
-
- conf->cards = cards;
- conf->cards[conf->count].devno = i;
- conf->cards[conf->count].list = list;
- conf->cards[conf->count].type = type;
- snprintf(name, 20, "DVB-%c card n. %d", type==TUNER_TER ? 'T' : (type==TUNER_CBL ? 'C' : 'S'), conf->count+1);
- conf->cards[conf->count].name = name;
- conf->count++;
- }
-
- if(conf->count == 0)
- {
- free(conf);
- conf = NULL;
- }
-
- return conf;
+ if(list == NULL)
+ continue;
+
+ size = sizeof(dvb_card_config_t) * (conf->count + 1);
+ tmp = realloc(conf->cards, size);
+
+ if(tmp == NULL)
+ {
+ fprintf(stderr, "DVB_CONFIG, can't realloc %d bytes, skipping\n", size);
+ continue;
+ }
+ cards = tmp;
+
+ name = malloc(20);
+ if(name==NULL)
+ {
+ fprintf(stderr, "DVB_CONFIG, can't realloc 20 bytes, skipping\n");
+ continue;
+ }
+
+ conf->cards = cards;
+ conf->cards[conf->count].devno = i;
+ conf->cards[conf->count].list = list;
+ conf->cards[conf->count].type = type;
+ snprintf(name, 20, "DVB-%c card n. %d", type==TUNER_TER ? 'T' : (type==TUNER_CBL ? 'C' : 'S'), conf->count+1);
+ conf->cards[conf->count].name = name;
+ conf->count++;
+ }
+
+ if(conf->count == 0)
+ {
+ free(conf);
+ conf = NULL;
+ }
+
+ return conf;
}
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 5014c90d9a..87d34df91b 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -47,7 +47,7 @@
static char* dvd_device_current;
int dvd_angle=1;
-#define LIBDVDREAD_VERSION(maj,min,micro) ((maj)*10000 + (min)*100 + (micro))
+#define LIBDVDREAD_VERSION(maj,min,micro) ((maj)*10000 + (min)*100 + (micro))
/*
* Try to autodetect the libdvd-0.9.0 library
* (0.9.0 removed the <dvdread/dvd_udf.h> header, and moved the two defines
@@ -56,9 +56,9 @@ int dvd_angle=1;
*/
#ifndef DVDREAD_VERSION
#if defined(DVD_VIDEO_LB_LEN) && defined(MAX_UDF_FILE_NAME_LEN)
-#define DVDREAD_VERSION LIBDVDREAD_VERSION(0,9,0)
+#define DVDREAD_VERSION LIBDVDREAD_VERSION(0,9,0)
#else
-#define DVDREAD_VERSION LIBDVDREAD_VERSION(0,8,0)
+#define DVDREAD_VERSION LIBDVDREAD_VERSION(0,8,0)
#endif
#endif
@@ -266,7 +266,7 @@ read_next:
if(d->angle_seek) {
int i,skip=0;
- for(i=0;i<9;i++) // check if all values zero:
+ for(i=0;i<9;i++) // check if all values zero:
if((skip=d->dsi_pack.sml_agli.data[i].address)!=0) break;
if(skip && skip!=0x7fffffff) {
// sml_agli table has valid data (at least one non-zero):
diff --git a/stream/stream_radio.c b/stream/stream_radio.c
index 315b28a613..4dc60ae112 100644
--- a/stream/stream_radio.c
+++ b/stream/stream_radio.c
@@ -633,7 +633,7 @@ int radio_get_freq(struct stream *stream, float *frequency){
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (!frequency)
- return 0;
+ return 0;
if (get_frequency(priv,frequency)!=STREAM_OK){
return 0;
}
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index 4469978359..3af98b4702 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -33,7 +33,7 @@ struct priv {
static void smb_auth_fn(const char *server, const char *share,
char *workgroup, int wgmaxlen, char *username, int unmaxlen,
- char *password, int pwmaxlen)
+ char *password, int pwmaxlen)
{
strncpy(workgroup, "LAN", wgmaxlen - 1);
}
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 3a9d644cc6..c0da02a324 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -111,7 +111,7 @@ static int open_s(stream_t *stream,int mode)
device[4] = dev ? dev[0] : 0;
/* open() can't be used for devices so do it the complicated way */
hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+ OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
f = _open_osfhandle((intptr_t)hd, _O_RDONLY);
#else
f=open(dev,O_RDONLY | O_CLOEXEC);
diff --git a/stream/tv.c b/stream/tv.c
index b9e5a97b9b..80e6c5e990 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -249,12 +249,12 @@ static int demux_tv_fill_buffer(demuxer_t *demux)
if (want_video && tvh->functions->control(tvh->priv,
TVI_CONTROL_IS_VIDEO, 0) == TVI_CONTROL_TRUE)
{
- len = tvh->functions->get_video_framesize(tvh->priv);
- dp=new_demux_packet(len);
+ len = tvh->functions->get_video_framesize(tvh->priv);
+ dp=new_demux_packet(len);
dp->keyframe = true;
- dp->pts=tvh->functions->grab_video_frame(tvh->priv, dp->buffer, len);
- demuxer_add_packet(demux, want_video, dp);
- }
+ dp->pts=tvh->functions->grab_video_frame(tvh->priv, dp->buffer, len);
+ demuxer_add_packet(demux, want_video, dp);
+ }
if (tvh->tv_param->scan) tv_scan(tvh);
return 1;
@@ -387,8 +387,8 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
MP_VERBOSE(tvh, "Selected norm : %s\n", norm);
if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) {
- MP_ERR(tvh, "Error: Cannot set norm!\n");
- return 0;
+ MP_ERR(tvh, "Error: Cannot set norm!\n");
+ return 0;
}
return 1;
}
@@ -431,8 +431,8 @@ static int open_tv(tvi_handle_t *tvh)
if (funcs->control(tvh->priv, TVI_CONTROL_IS_VIDEO, 0) != TVI_CONTROL_TRUE)
{
- MP_ERR(tvh, "Error: No video input present!\n");
- return 0;
+ MP_ERR(tvh, "Error: No video input present!\n");
+ return 0;
}
if (tvh->tv_param->outfmt == -1)
@@ -447,25 +447,25 @@ static int open_tv(tvi_handle_t *tvh)
{
switch(tvh->tv_param->outfmt)
{
- case MP_FOURCC_YV12:
- case MP_FOURCC_I420:
- case MP_FOURCC_UYVY:
- case MP_FOURCC_YUY2:
- case MP_FOURCC_RGB32:
- case MP_FOURCC_RGB24:
- case MP_FOURCC_BGR32:
- case MP_FOURCC_BGR24:
- case MP_FOURCC_BGR16:
- case MP_FOURCC_BGR15:
- break;
- default:
- MP_ERR(tvh, "==================================================================\n"\
- " WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUESTED (0x%x)\n"\
- " This may cause buggy playback or program crash! Bug reports will\n"\
- " be ignored! You should try again with YV12 (which is the default\n"\
- " colorspace) and read the documentation!\n"\
- "==================================================================\n"
- ,tvh->tv_param->outfmt);
+ case MP_FOURCC_YV12:
+ case MP_FOURCC_I420:
+ case MP_FOURCC_UYVY:
+ case MP_FOURCC_YUY2:
+ case MP_FOURCC_RGB32:
+ case MP_FOURCC_RGB24:
+ case MP_FOURCC_BGR32:
+ case MP_FOURCC_BGR24:
+ case MP_FOURCC_BGR16:
+ case MP_FOURCC_BGR15:
+ break;
+ default:
+ MP_ERR(tvh, "==================================================================\n"\
+ " WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUESTED (0x%x)\n"\
+ " This may cause buggy playback or program crash! Bug reports will\n"\
+ " be ignored! You should try again with YV12 (which is the default\n"\
+ " colorspace) and read the documentation!\n"\
+ "==================================================================\n"
+ ,tvh->tv_param->outfmt);
}
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &tvh->tv_param->outfmt);
}
@@ -488,155 +488,155 @@ static int open_tv(tvi_handle_t *tvh)
/* set width */
if (tvh->tv_param->width != -1)
{
- if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_WIDTH, &tvh->tv_param->width) == TVI_CONTROL_TRUE)
- funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tvh->tv_param->width);
- else
- {
- MP_ERR(tvh, "Unable to set requested width: %d\n", tvh->tv_param->width);
- funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &tvh->tv_param->width);
- }
+ if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_WIDTH, &tvh->tv_param->width) == TVI_CONTROL_TRUE)
+ funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tvh->tv_param->width);
+ else
+ {
+ MP_ERR(tvh, "Unable to set requested width: %d\n", tvh->tv_param->width);
+ funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &tvh->tv_param->width);
+ }
}
/* set height */
if (tvh->tv_param->height != -1)
{
- if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_HEIGHT, &tvh->tv_param->height) == TVI_CONTROL_TRUE)
- funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tvh->tv_param->height);
- else
- {
- MP_ERR(tvh, "Unable to set requested height: %d\n", tvh->tv_param->height);
- funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HEIGHT, &tvh->tv_param->height);
- }
+ if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_HEIGHT, &tvh->tv_param->height) == TVI_CONTROL_TRUE)
+ funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tvh->tv_param->height);
+ else
+ {
+ MP_ERR(tvh, "Unable to set requested height: %d\n", tvh->tv_param->height);
+ funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HEIGHT, &tvh->tv_param->height);
+ }
}
if (funcs->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) != TVI_CONTROL_TRUE)
{
- MP_WARN(tvh, "Selected input hasn't got a tuner!\n");
- goto done;
+ MP_WARN(tvh, "Selected input hasn't got a tuner!\n");
+ goto done;
}
/* select channel list */
for (i = 0; chanlists[i].name != NULL; i++)
{
- if (!strcasecmp(chanlists[i].name, tvh->tv_param->chanlist))
- {
- tvh->chanlist = i;
- tvh->chanlist_s = chanlists[i].list;
- break;
- }
+ if (!strcasecmp(chanlists[i].name, tvh->tv_param->chanlist))
+ {
+ tvh->chanlist = i;
+ tvh->chanlist_s = chanlists[i].list;
+ break;
+ }
}
if (tvh->chanlist == -1) {
- MP_WARN(tvh, "Unable to find selected channel list! (%s)\n",
- tvh->tv_param->chanlist);
+ MP_WARN(tvh, "Unable to find selected channel list! (%s)\n",
+ tvh->tv_param->chanlist);
return 0;
} else
- MP_VERBOSE(tvh, "Selected channel list: %s (including %d channels)\n",
- chanlists[tvh->chanlist].name, chanlists[tvh->chanlist].count);
+ MP_VERBOSE(tvh, "Selected channel list: %s (including %d channels)\n",
+ chanlists[tvh->chanlist].name, chanlists[tvh->chanlist].count);
if (tvh->tv_param->freq && tvh->tv_param->channel)
{
- MP_WARN(tvh, "You can't set frequency and channel simultaneously!\n");
- goto done;
+ MP_WARN(tvh, "You can't set frequency and channel simultaneously!\n");
+ goto done;
}
/* Handle channel names */
if (tvh->tv_param->channels) {
parse_channels(tvh);
} else
- tv_channel_last_real = malloc(5);
+ tv_channel_last_real = malloc(5);
if (tv_channel_list) {
- int channel = 0;
- if (tvh->tv_param->channel)
- {
- if (isdigit(*tvh->tv_param->channel))
- /* if tvh->tv_param->channel begins with a digit interpret it as a number */
- channel = atoi(tvh->tv_param->channel);
- else
- {
- /* if tvh->tv_param->channel does not begin with a digit
- set the first channel that contains tvh->tv_param->channel in its name */
-
- tv_channel_current = tv_channel_list;
- while ( tv_channel_current ) {
- if ( strstr(tv_channel_current->name, tvh->tv_param->channel) )
- break;
- tv_channel_current = tv_channel_current->next;
- }
- if ( !tv_channel_current ) tv_channel_current = tv_channel_list;
- }
- }
- else
- channel = 1;
-
- if ( channel ) {
- tv_channel_current = tv_channel_list;
- for (int n = 1; n < channel; n++)
- if (tv_channel_current->next)
- tv_channel_current = tv_channel_current->next;
- }
-
- set_norm_and_freq(tvh, tv_channel_current);
- tv_channel_last = tv_channel_current;
+ int channel = 0;
+ if (tvh->tv_param->channel)
+ {
+ if (isdigit(*tvh->tv_param->channel))
+ /* if tvh->tv_param->channel begins with a digit interpret it as a number */
+ channel = atoi(tvh->tv_param->channel);
+ else
+ {
+ /* if tvh->tv_param->channel does not begin with a digit
+ set the first channel that contains tvh->tv_param->channel in its name */
+
+ tv_channel_current = tv_channel_list;
+ while ( tv_channel_current ) {
+ if ( strstr(tv_channel_current->name, tvh->tv_param->channel) )
+ break;
+ tv_channel_current = tv_channel_current->next;
+ }
+ if ( !tv_channel_current ) tv_channel_current = tv_channel_list;
+ }
+ }
+ else
+ channel = 1;
+
+ if ( channel ) {
+ tv_channel_current = tv_channel_list;
+ for (int n = 1; n < channel; n++)
+ if (tv_channel_current->next)
+ tv_channel_current = tv_channel_current->next;
+ }
+
+ set_norm_and_freq(tvh, tv_channel_current);
+ tv_channel_last = tv_channel_current;
} else {
/* we need to set frequency */
if (tvh->tv_param->freq)
{
- unsigned long freq = atof(tvh->tv_param->freq)*16;
+ unsigned long freq = atof(tvh->tv_param->freq)*16;
/* set freq in MHz */
- funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
+ funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
- funcs->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
- MP_VERBOSE(tvh, "Selected frequency: %lu (%.3f)\n",
- freq, freq/16.0);
+ funcs->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
+ MP_VERBOSE(tvh, "Selected frequency: %lu (%.3f)\n",
+ freq, freq/16.0);
}
- if (tvh->tv_param->channel) {
- struct CHANLIST cl;
-
- MP_VERBOSE(tvh, "Requested channel: %s\n", tvh->tv_param->channel);
- for (i = 0; i < chanlists[tvh->chanlist].count; i++)
- {
- cl = tvh->chanlist_s[i];
- // printf("count%d: name: %s, freq: %d\n",
- // i, cl.name, cl.freq);
- if (!strcasecmp(cl.name, tvh->tv_param->channel))
- {
- strcpy(tv_channel_last_real, cl.name);
- tvh->channel = i;
- MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
- cl.name, cl.freq/1000.0);
- tv_set_freq_float(tvh, cl.freq);
- break;
- }
- }
+ if (tvh->tv_param->channel) {
+ struct CHANLIST cl;
+
+ MP_VERBOSE(tvh, "Requested channel: %s\n", tvh->tv_param->channel);
+ for (i = 0; i < chanlists[tvh->chanlist].count; i++)
+ {
+ cl = tvh->chanlist_s[i];
+ // printf("count%d: name: %s, freq: %d\n",
+ // i, cl.name, cl.freq);
+ if (!strcasecmp(cl.name, tvh->tv_param->channel))
+ {
+ strcpy(tv_channel_last_real, cl.name);
+ tvh->channel = i;
+ MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
+ cl.name, cl.freq/1000.0);
+ tv_set_freq_float(tvh, cl.freq);
+ break;
+ }
+ }
}
}
/* grep frequency in chanlist */
{
- unsigned long i2;
- int freq;
+ unsigned long i2;
+ int freq;
- tv_get_freq(tvh, &i2);
+ tv_get_freq(tvh, &i2);
- freq = (int) (((float)(i2/16))*1000)+250;
+ freq = (int) (((float)(i2/16))*1000)+250;
- for (i = 0; i < chanlists[tvh->chanlist].count; i++)
- {
- if (tvh->chanlist_s[i].freq == freq)
- {
- tvh->channel = i+1;
- break;
- }
- }
+ for (i = 0; i < chanlists[tvh->chanlist].count; i++)
+ {
+ if (tvh->chanlist_s[i].freq == freq)
+ {
+ tvh->channel = i+1;
+ break;
+ }
+ }
}
done:
/* also start device! */
- return 1;
+ return 1;
}
static tvi_handle_t *tv_begin(tv_param_t* tv_param, struct mp_log *log)
@@ -646,12 +646,12 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param, struct mp_log *log)
if(tv_param->driver && !strcmp(tv_param->driver,"help")){
mp_info(log, "Available drivers:\n");
for(i=0;tvi_driver_list[i];i++){
- mp_info(log, " %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name);
- if(tvi_driver_list[i]->comment)
- mp_info(log, " (%s)",tvi_driver_list[i]->comment);
- mp_info(log, "\n");
- }
- return NULL;
+ mp_info(log, " %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name);
+ if(tvi_driver_list[i]->comment)
+ mp_info(log, " (%s)",tvi_driver_list[i]->comment);
+ mp_info(log, "\n");
+ }
+ return NULL;
}
for(i=0;tvi_driver_list[i];i++){
@@ -711,8 +711,8 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
tvh->demuxer = demuxer;
if (!open_tv(tvh)){
- tv_uninit(tvh);
- return -1;
+ tv_uninit(tvh);
+ return -1;
}
funcs = tvh->functions;
demuxer->priv=tvh;
@@ -761,71 +761,71 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
/* here comes audio init */
if (tvh->tv_param->noaudio == 0 && funcs->control(tvh->priv, TVI_CONTROL_IS_AUDIO, 0) == TVI_CONTROL_TRUE)
{
- int audio_format;
-
- /* yeah, audio is present */
-
- funcs->control(tvh->priv, TVI_CONTROL_AUD_SET_SAMPLERATE,
- &tvh->tv_param->audiorate);
-
- if (funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_FORMAT, &audio_format) != TVI_CONTROL_TRUE)
- goto no_audio;
-
- switch(audio_format)
- {
- case AF_FORMAT_U8:
- case AF_FORMAT_S8:
- case AF_FORMAT_U16_LE:
- case AF_FORMAT_U16_BE:
- case AF_FORMAT_S16_LE:
- case AF_FORMAT_S16_BE:
- case AF_FORMAT_S32_LE:
- case AF_FORMAT_S32_BE:
- break;
- case AF_FORMAT_MPEG2:
- default:
- MP_ERR(tvh, "Audio type '%s' unsupported!\n",
- af_fmt_to_str(audio_format));
- goto no_audio;
- }
-
- struct sh_stream *sh_a = new_sh_stream(demuxer, STREAM_AUDIO);
- sh_audio = sh_a->audio;
-
- funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE,
+ int audio_format;
+
+ /* yeah, audio is present */
+
+ funcs->control(tvh->priv, TVI_CONTROL_AUD_SET_SAMPLERATE,
+ &tvh->tv_param->audiorate);
+
+ if (funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_FORMAT, &audio_format) != TVI_CONTROL_TRUE)
+ goto no_audio;
+
+ switch(audio_format)
+ {
+ case AF_FORMAT_U8:
+ case AF_FORMAT_S8:
+ case AF_FORMAT_U16_LE:
+ case AF_FORMAT_U16_BE:
+ case AF_FORMAT_S16_LE:
+ case AF_FORMAT_S16_BE:
+ case AF_FORMAT_S32_LE:
+ case AF_FORMAT_S32_BE:
+ break;
+ case AF_FORMAT_MPEG2:
+ default:
+ MP_ERR(tvh, "Audio type '%s' unsupported!\n",
+ af_fmt_to_str(audio_format));
+ goto no_audio;
+ }
+
+ struct sh_stream *sh_a = new_sh_stream(demuxer, STREAM_AUDIO);
+ sh_audio = sh_a->audio;
+
+ funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE,
&sh_audio->samplerate);
int nchannels = sh_audio->channels.num;
- funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_CHANNELS,
+ funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_CHANNELS,
&nchannels);
mp_chmap_from_channels(&sh_audio->channels, nchannels);
sh_a->codec = "mp-pcm";
- sh_a->format = audio_format;
+ sh_a->format = audio_format;
int samplesize = af_fmt2bits(audio_format) / 8;
- sh_audio->i_bps =
- sh_audio->samplerate * samplesize * sh_audio->channels.num;
+ sh_audio->i_bps =
+ sh_audio->samplerate * samplesize * sh_audio->channels.num;
- // emulate WF for win32 codecs:
- sh_audio->wf = talloc_zero(sh_audio, MP_WAVEFORMATEX);
- sh_audio->wf->wFormatTag = sh_a->format;
- sh_audio->wf->nChannels = sh_audio->channels.num;
- sh_audio->wf->wBitsPerSample = samplesize * 8;
- sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
- sh_audio->wf->nBlockAlign = samplesize * sh_audio->channels.num;
- sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps;
+ // emulate WF for win32 codecs:
+ sh_audio->wf = talloc_zero(sh_audio, MP_WAVEFORMATEX);
+ sh_audio->wf->wFormatTag = sh_a->format;
+ sh_audio->wf->nChannels = sh_audio->channels.num;
+ sh_audio->wf->wBitsPerSample = samplesize * 8;
+ sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
+ sh_audio->wf->nBlockAlign = samplesize * sh_audio->channels.num;
+ sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps;
- MP_VERBOSE(tvh, " TV audio: %d channels, %d bits, %d Hz\n",
+ MP_VERBOSE(tvh, " TV audio: %d channels, %d bits, %d Hz\n",
sh_audio->wf->nChannels, sh_audio->wf->wBitsPerSample,
sh_audio->wf->nSamplesPerSec);
}
no_audio:
if(!(funcs->start(tvh->priv))){
- // start failed :(
- tv_uninit(tvh);
- return -1;
+ // start failed :(
+ tv_uninit(tvh);
+ return -1;
}
/* set color eq */
@@ -856,16 +856,16 @@ int tv_set_color_options(tvi_handle_t *tvh, int opt, int value)
switch(opt)
{
- case TV_COLOR_BRIGHTNESS:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_BRIGHTNESS, &value);
- case TV_COLOR_HUE:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HUE, &value);
- case TV_COLOR_SATURATION:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_SATURATION, &value);
- case TV_COLOR_CONTRAST:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_CONTRAST, &value);
- default:
- MP_WARN(tvh, "Unknown color option (%d) specified!\n", opt);
+ case TV_COLOR_BRIGHTNESS:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_BRIGHTNESS, &value);
+ case TV_COLOR_HUE:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HUE, &value);
+ case TV_COLOR_SATURATION:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_SATURATION, &value);
+ case TV_COLOR_CONTRAST:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_CONTRAST, &value);
+ default:
+ MP_WARN(tvh, "Unknown color option (%d) specified!\n", opt);
}
return TVI_CONTROL_UNKNOWN;
@@ -877,16 +877,16 @@ int tv_get_color_options(tvi_handle_t *tvh, int opt, int* value)
switch(opt)
{
- case TV_COLOR_BRIGHTNESS:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_BRIGHTNESS, value);
- case TV_COLOR_HUE:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HUE, value);
- case TV_COLOR_SATURATION:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_SATURATION, value);
- case TV_COLOR_CONTRAST:
- return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_CONTRAST, value);
- default:
- MP_WARN(tvh, "Unknown color option (%d) specified!\n", opt);
+ case TV_COLOR_BRIGHTNESS:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_BRIGHTNESS, value);
+ case TV_COLOR_HUE:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HUE, value);
+ case TV_COLOR_SATURATION:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_SATURATION, value);
+ case TV_COLOR_CONTRAST:
+ return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_CONTRAST, value);
+ default:
+ MP_WARN(tvh, "Unknown color option (%d) specified!\n", opt);
}
return TVI_CONTROL_UNKNOWN;
@@ -896,9 +896,9 @@ int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq)
{
if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) == TVI_CONTROL_TRUE)
{
- tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, freq);
- MP_VERBOSE(tvh, "Current frequency: %lu (%.3f)\n",
- *freq, *freq/16.0);
+ tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, freq);
+ MP_VERBOSE(tvh, "Current frequency: %lu (%.3f)\n",
+ *freq, *freq/16.0);
}
return 1;
}
@@ -907,14 +907,14 @@ int tv_set_freq(tvi_handle_t *tvh, unsigned long freq)
{
if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) == TVI_CONTROL_TRUE)
{
-// unsigned long freq = atof(tvh->tv_param->freq)*16;
+// unsigned long freq = atof(tvh->tv_param->freq)*16;
/* set freq in MHz */
- tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
+ tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
- tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
- MP_VERBOSE(tvh, "Current frequency: %lu (%.3f)\n",
- freq, freq/16.0);
+ tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
+ MP_VERBOSE(tvh, "Current frequency: %lu (%.3f)\n",
+ freq, freq/16.0);
}
return 1;
}
@@ -952,123 +952,123 @@ int tv_step_channel_real(tvi_handle_t *tvh, int direction)
tvh->tv_param->scan=0;
if (direction == TV_CHANNEL_LOWER)
{
- if (tvh->channel-1 >= 0)
- {
- strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
- cl = tvh->chanlist_s[--tvh->channel];
- MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
- cl.name, cl.freq/1000.0);
- tv_set_freq_float(tvh, cl.freq);
- }
+ if (tvh->channel-1 >= 0)
+ {
+ strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
+ cl = tvh->chanlist_s[--tvh->channel];
+ MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
+ cl.name, cl.freq/1000.0);
+ tv_set_freq_float(tvh, cl.freq);
+ }
}
if (direction == TV_CHANNEL_HIGHER)
{
- if (tvh->channel+1 < chanlists[tvh->chanlist].count)
- {
- strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
- cl = tvh->chanlist_s[++tvh->channel];
- MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
- cl.name, cl.freq/1000.0);
- tv_set_freq_float(tvh, cl.freq);
- }
+ if (tvh->channel+1 < chanlists[tvh->chanlist].count)
+ {
+ strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
+ cl = tvh->chanlist_s[++tvh->channel];
+ MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
+ cl.name, cl.freq/1000.0);
+ tv_set_freq_float(tvh, cl.freq);
+ }
}
return 1;
}
int tv_step_channel(tvi_handle_t *tvh, int direction) {
- tvh->tv_param->scan=0;
- if (tv_channel_list) {
- if (direction == TV_CHANNEL_HIGHER) {
- tv_channel_last = tv_channel_current;
- if (tv_channel_current->next)
- tv_channel_current = tv_channel_current->next;
- else
- tv_channel_current = tv_channel_list;
- set_norm_and_freq(tvh, tv_channel_current);
- }
- if (direction == TV_CHANNEL_LOWER) {
- tv_channel_last = tv_channel_current;
- if (tv_channel_current->prev)
- tv_channel_current = tv_channel_current->prev;
- else
- while (tv_channel_current->next)
- tv_channel_current = tv_channel_current->next;
- set_norm_and_freq(tvh, tv_channel_current);
- }
- } else tv_step_channel_real(tvh, direction);
- return 1;
+ tvh->tv_param->scan=0;
+ if (tv_channel_list) {
+ if (direction == TV_CHANNEL_HIGHER) {
+ tv_channel_last = tv_channel_current;
+ if (tv_channel_current->next)
+ tv_channel_current = tv_channel_current->next;
+ else
+ tv_channel_current = tv_channel_list;
+ set_norm_and_freq(tvh, tv_channel_current);
+ }
+ if (direction == TV_CHANNEL_LOWER) {
+ tv_channel_last = tv_channel_current;
+ if (tv_channel_current->prev)
+ tv_channel_current = tv_channel_current->prev;
+ else
+ while (tv_channel_current->next)
+ tv_channel_current = tv_channel_current->next;
+ set_norm_and_freq(tvh, tv_channel_current);
+ }
+ } else tv_step_channel_real(tvh, direction);
+ return 1;
}
int tv_set_channel_real(tvi_handle_t *tvh, char *channel) {
- int i;
- struct CHANLIST cl;
+ int i;
+ struct CHANLIST cl;
tvh->tv_param->scan=0;
strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
- for (i = 0; i < chanlists[tvh->chanlist].count; i++)
- {
- cl = tvh->chanlist_s[i];
-// printf("count%d: name: %s, freq: %d\n",
-// i, cl.name, cl.freq);
- if (!strcasecmp(cl.name, channel))
- {
- tvh->channel = i;
- MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
- cl.name, cl.freq/1000.0);
- tv_set_freq_float(tvh, cl.freq);
- break;
- }
- }
- return 1;
+ for (i = 0; i < chanlists[tvh->chanlist].count; i++)
+ {
+ cl = tvh->chanlist_s[i];
+// printf("count%d: name: %s, freq: %d\n",
+// i, cl.name, cl.freq);
+ if (!strcasecmp(cl.name, channel))
+ {
+ tvh->channel = i;
+ MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
+ cl.name, cl.freq/1000.0);
+ tv_set_freq_float(tvh, cl.freq);
+ break;
+ }
+ }
+ return 1;
}
int tv_set_channel(tvi_handle_t *tvh, char *channel) {
- int i, channel_int;
-
- tvh->tv_param->scan=0;
- if (tv_channel_list) {
- tv_channel_last = tv_channel_current;
- channel_int = atoi(channel);
- tv_channel_current = tv_channel_list;
- for (i = 1; i < channel_int; i++)
- if (tv_channel_current->next)
- tv_channel_current = tv_channel_current->next;
- set_norm_and_freq(tvh, tv_channel_current);
- } else tv_set_channel_real(tvh, channel);
- return 1;
+ int i, channel_int;
+
+ tvh->tv_param->scan=0;
+ if (tv_channel_list) {
+ tv_channel_last = tv_channel_current;
+ channel_int = atoi(channel);
+ tv_channel_current = tv_channel_list;
+ for (i = 1; i < channel_int; i++)
+ if (tv_channel_current->next)
+ tv_channel_current = tv_channel_current->next;
+ set_norm_and_freq(tvh, tv_channel_current);
+ } else tv_set_channel_real(tvh, channel);
+ return 1;
}
int tv_last_channel(tvi_handle_t *tvh) {
- tvh->tv_param->scan=0;
- if (tv_channel_list) {
- tv_channels_t *tmp;
-
- tmp = tv_channel_last;
- tv_channel_last = tv_channel_current;
- tv_channel_current = tmp;
-
- set_norm_and_freq(tvh, tv_channel_current);
- } else {
- int i;
- struct CHANLIST cl;
-
- for (i = 0; i < chanlists[tvh->chanlist].count; i++)
- {
- cl = tvh->chanlist_s[i];
- if (!strcasecmp(cl.name, tv_channel_last_real))
- {
- strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
- tvh->channel = i;
- MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
- cl.name, cl.freq/1000.0);
- tv_set_freq_float(tvh, cl.freq);
- break;
- }
- }
- }
- return 1;
+ tvh->tv_param->scan=0;
+ if (tv_channel_list) {
+ tv_channels_t *tmp;
+
+ tmp = tv_channel_last;
+ tv_channel_last = tv_channel_current;
+ tv_channel_current = tmp;
+
+ set_norm_and_freq(tvh, tv_channel_current);
+ } else {
+ int i;
+ struct CHANLIST cl;
+
+ for (i = 0; i < chanlists[tvh->chanlist].count; i++)
+ {
+ cl = tvh->chanlist_s[i];
+ if (!strcasecmp(cl.name, tv_channel_last_real))
+ {
+ strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
+ tvh->channel = i;
+ MP_INFO(tvh, "Selected channel: %s (freq: %.3f)\n",
+ cl.name, cl.freq/1000.0);
+ tv_set_freq_float(tvh, cl.freq);
+ break;
+ }
+ }
+ }
+ return 1;
}
int tv_step_norm(tvi_handle_t *tvh)
diff --git a/stream/tv.h b/stream/tv.h
index 4ab064e7fd..4323762139 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -103,16 +103,16 @@ typedef struct tvi_functions_s
typedef struct tvi_handle_s {
struct mp_log *log;
- const tvi_functions_t *functions;
- void *priv;
- int seq;
- struct demuxer *demuxer;
+ const tvi_functions_t *functions;
+ void *priv;
+ int seq;
+ struct demuxer *demuxer;
/* specific */
- int norm;
- int chanlist;
+ int norm;
+ int chanlist;
const struct CHANLIST *chanlist_s;
- int channel;
+ int channel;
tv_param_t * tv_param;
void * scan;
} tvi_handle_t;
@@ -137,79 +137,79 @@ typedef struct {
int new_channels;
} tv_scan_t;
-#define TVI_CONTROL_FALSE 0
-#define TVI_CONTROL_TRUE 1
-#define TVI_CONTROL_NA -1
-#define TVI_CONTROL_UNKNOWN -2
+#define TVI_CONTROL_FALSE 0
+#define TVI_CONTROL_TRUE 1
+#define TVI_CONTROL_NA -1
+#define TVI_CONTROL_UNKNOWN -2
/* ======================== CONTROLS =========================== */
/* GENERIC controls */
-#define TVI_CONTROL_IS_AUDIO 0x1
-#define TVI_CONTROL_IS_VIDEO 0x2
-#define TVI_CONTROL_IS_TUNER 0x3
+#define TVI_CONTROL_IS_AUDIO 0x1
+#define TVI_CONTROL_IS_VIDEO 0x2
+#define TVI_CONTROL_IS_TUNER 0x3
#define TVI_CONTROL_IMMEDIATE 0x4
/* VIDEO controls */
-#define TVI_CONTROL_VID_GET_FPS 0x101
-#define TVI_CONTROL_VID_GET_PLANES 0x102
-#define TVI_CONTROL_VID_GET_BITS 0x103
-#define TVI_CONTROL_VID_CHK_BITS 0x104
-#define TVI_CONTROL_VID_SET_BITS 0x105
-#define TVI_CONTROL_VID_GET_FORMAT 0x106
-#define TVI_CONTROL_VID_CHK_FORMAT 0x107
-#define TVI_CONTROL_VID_SET_FORMAT 0x108
-#define TVI_CONTROL_VID_GET_WIDTH 0x109
-#define TVI_CONTROL_VID_CHK_WIDTH 0x110
-#define TVI_CONTROL_VID_SET_WIDTH 0x111
-#define TVI_CONTROL_VID_GET_HEIGHT 0x112
-#define TVI_CONTROL_VID_CHK_HEIGHT 0x113
-#define TVI_CONTROL_VID_SET_HEIGHT 0x114
-#define TVI_CONTROL_VID_GET_BRIGHTNESS 0x115
-#define TVI_CONTROL_VID_SET_BRIGHTNESS 0x116
-#define TVI_CONTROL_VID_GET_HUE 0x117
-#define TVI_CONTROL_VID_SET_HUE 0x118
-#define TVI_CONTROL_VID_GET_SATURATION 0x119
-#define TVI_CONTROL_VID_SET_SATURATION 0x11a
-#define TVI_CONTROL_VID_GET_CONTRAST 0x11b
-#define TVI_CONTROL_VID_SET_CONTRAST 0x11c
-#define TVI_CONTROL_VID_GET_PICTURE 0x11d
-#define TVI_CONTROL_VID_SET_PICTURE 0x11e
-#define TVI_CONTROL_VID_SET_GAIN 0x11f
-#define TVI_CONTROL_VID_GET_GAIN 0x120
-#define TVI_CONTROL_VID_SET_WIDTH_HEIGHT 0x121
+#define TVI_CONTROL_VID_GET_FPS 0x101
+#define TVI_CONTROL_VID_GET_PLANES 0x102
+#define TVI_CONTROL_VID_GET_BITS 0x103
+#define TVI_CONTROL_VID_CHK_BITS 0x104
+#define TVI_CONTROL_VID_SET_BITS 0x105
+#define TVI_CONTROL_VID_GET_FORMAT 0x106
+#define TVI_CONTROL_VID_CHK_FORMAT 0x107
+#define TVI_CONTROL_VID_SET_FORMAT 0x108
+#define TVI_CONTROL_VID_GET_WIDTH 0x109
+#define TVI_CONTROL_VID_CHK_WIDTH 0x110
+#define TVI_CONTROL_VID_SET_WIDTH 0x111
+#define TVI_CONTROL_VID_GET_HEIGHT 0x112
+#define TVI_CONTROL_VID_CHK_HEIGHT 0x113
+#define TVI_CONTROL_VID_SET_HEIGHT 0x114
+#define TVI_CONTROL_VID_GET_BRIGHTNESS 0x115
+#define TVI_CONTROL_VID_SET_BRIGHTNESS 0x116
+#define TVI_CONTROL_VID_GET_HUE 0x117
+#define TVI_CONTROL_VID_SET_HUE 0x118
+#define TVI_CONTROL_VID_GET_SATURATION 0x119
+#define TVI_CONTROL_VID_SET_SATURATION 0x11a
+#define TVI_CONTROL_VID_GET_CONTRAST 0x11b
+#define TVI_CONTROL_VID_SET_CONTRAST 0x11c
+#define TVI_CONTROL_VID_GET_PICTURE 0x11d
+#define TVI_CONTROL_VID_SET_PICTURE 0x11e
+#define TVI_CONTROL_VID_SET_GAIN 0x11f
+#define TVI_CONTROL_VID_GET_GAIN 0x120
+#define TVI_CONTROL_VID_SET_WIDTH_HEIGHT 0x121
/* TUNER controls */
-#define TVI_CONTROL_TUN_GET_FREQ 0x201
-#define TVI_CONTROL_TUN_SET_FREQ 0x202
-#define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */
-#define TVI_CONTROL_TUN_SET_TUNER 0x204 /* update priv->tuner struct for used input */
-#define TVI_CONTROL_TUN_GET_NORM 0x205
-#define TVI_CONTROL_TUN_SET_NORM 0x206
-#define TVI_CONTROL_TUN_GET_SIGNAL 0x207
+#define TVI_CONTROL_TUN_GET_FREQ 0x201
+#define TVI_CONTROL_TUN_SET_FREQ 0x202
+#define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */
+#define TVI_CONTROL_TUN_SET_TUNER 0x204 /* update priv->tuner struct for used input */
+#define TVI_CONTROL_TUN_GET_NORM 0x205
+#define TVI_CONTROL_TUN_SET_NORM 0x206
+#define TVI_CONTROL_TUN_GET_SIGNAL 0x207
/* AUDIO controls */
-#define TVI_CONTROL_AUD_GET_FORMAT 0x301
-#define TVI_CONTROL_AUD_GET_SAMPLERATE 0x302
-#define TVI_CONTROL_AUD_GET_CHANNELS 0x304
-#define TVI_CONTROL_AUD_SET_SAMPLERATE 0x305
+#define TVI_CONTROL_AUD_GET_FORMAT 0x301
+#define TVI_CONTROL_AUD_GET_SAMPLERATE 0x302
+#define TVI_CONTROL_AUD_GET_CHANNELS 0x304
+#define TVI_CONTROL_AUD_SET_SAMPLERATE 0x305
/* SPECIFIC controls */
-#define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */
-#define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */
-#define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */
+#define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */
+#define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */
+#define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */
int tv_set_color_options(tvi_handle_t *tvh, int opt, int val);
int tv_get_color_options(tvi_handle_t *tvh, int opt, int* val);
-#define TV_COLOR_BRIGHTNESS 1
-#define TV_COLOR_HUE 2
-#define TV_COLOR_SATURATION 3
-#define TV_COLOR_CONTRAST 4
+#define TV_COLOR_BRIGHTNESS 1
+#define TV_COLOR_HUE 2
+#define TV_COLOR_SATURATION 3
+#define TV_COLOR_CONTRAST 4
int tv_step_channel_real(tvi_handle_t *tvh, int direction);
int tv_step_channel(tvi_handle_t *tvh, int direction);
-#define TV_CHANNEL_LOWER 1
-#define TV_CHANNEL_HIGHER 2
+#define TV_CHANNEL_LOWER 1
+#define TV_CHANNEL_HIGHER 2
int tv_last_channel(tvi_handle_t *tvh);
@@ -231,12 +231,12 @@ void tv_start_scan(tvi_handle_t *tvh, int start);
tvi_handle_t *tv_new_handle(int size, struct mp_log *log, const tvi_functions_t *functions);
void tv_free_handle(tvi_handle_t *h);
-#define TV_NORM_PAL 1
-#define TV_NORM_NTSC 2
-#define TV_NORM_SECAM 3
-#define TV_NORM_PALNC 4
-#define TV_NORM_PALM 5
-#define TV_NORM_PALN 6
-#define TV_NORM_NTSCJP 7
+#define TV_NORM_PAL 1
+#define TV_NORM_NTSC 2
+#define TV_NORM_SECAM 3
+#define TV_NORM_PALNC 4
+#define TV_NORM_PALM 5
+#define TV_NORM_PALN 6
+#define TV_NORM_NTSCJP 7
#endif /* MPLAYER_TV_H */
diff --git a/stream/tvi_def.h b/stream/tvi_def.h
index 41c1427e98..987141b462 100644
--- a/stream/tvi_def.h
+++ b/stream/tvi_def.h
@@ -70,7 +70,7 @@ static inline void fill_blank_frame(char* buffer,int len,int fmt){
buffer[i+1]=0;
buffer[i+2]=0;
buffer[i+3]=0;
- }
+ }
break;
case MP_FOURCC_YUY2:
for(i=0;i<len;i+=4){
@@ -78,13 +78,13 @@ static inline void fill_blank_frame(char* buffer,int len,int fmt){
buffer[i+1]=0xFF;
buffer[i+2]=0;
buffer[i+3]=0;
- }
+ }
break;
case MP_FOURCC_MJPEG:
/*
- This is compressed format. I don't know yet how to fill such frame with blue color.
- Keeping frame unchanged.
- */
+ This is compressed format. I don't know yet how to fill such frame with blue color.
+ Keeping frame unchanged.
+ */
break;
default:
memset(buffer,0xC0,len);
diff --git a/stream/tvi_dummy.c b/stream/tvi_dummy.c
index 0d9e86c210..3ce47f7a7c 100644
--- a/stream/tvi_dummy.c
+++ b/stream/tvi_dummy.c
@@ -27,11 +27,11 @@
static tvi_handle_t *tvi_init_dummy(struct mp_log *log, tv_param_t* tv_param);
/* information about this file */
const tvi_info_t tvi_info_dummy = {
- tvi_init_dummy,
- "NULL-TV",
- "dummy",
- "alex",
- NULL
+ tvi_init_dummy,
+ "NULL-TV",
+ "dummy",
+ "alex",
+ NULL
};
/* private data's */
@@ -71,36 +71,36 @@ static int do_control(priv_t *priv, int cmd, void *arg)
{
switch(cmd)
{
- case TVI_CONTROL_IS_VIDEO:
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_GET_FORMAT:
- *(int *)arg = MP_FOURCC_YV12;
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_SET_FORMAT:
- {
-// int req_fmt = *(int *)arg;
- int req_fmt = *(int *)arg;
- if (req_fmt != MP_FOURCC_YV12)
- return TVI_CONTROL_FALSE;
- return TVI_CONTROL_TRUE;
- }
- case TVI_CONTROL_VID_SET_WIDTH:
- priv->width = *(int *)arg;
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_GET_WIDTH:
- *(int *)arg = priv->width;
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_SET_HEIGHT:
- priv->height = *(int *)arg;
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_GET_HEIGHT:
- *(int *)arg = priv->height;
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_VID_CHK_WIDTH:
- case TVI_CONTROL_VID_CHK_HEIGHT:
- return TVI_CONTROL_TRUE;
- case TVI_CONTROL_TUN_SET_NORM:
- return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_IS_VIDEO:
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_GET_FORMAT:
+ *(int *)arg = MP_FOURCC_YV12;
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_SET_FORMAT:
+ {
+// int req_fmt = *(int *)arg;
+ int req_fmt = *(int *)arg;
+ if (req_fmt != MP_FOURCC_YV12)
+ return TVI_CONTROL_FALSE;
+ return TVI_CONTROL_TRUE;
+ }
+ case TVI_CONTROL_VID_SET_WIDTH:
+ priv->width = *(int *)arg;
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_GET_WIDTH:
+ *(int *)arg = priv->width;
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_SET_HEIGHT:
+ priv->height = *(int *)arg;
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_GET_HEIGHT:
+ *(int *)arg = priv->height;
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_VID_CHK_WIDTH:
+ case TVI_CONTROL_VID_CHK_HEIGHT:
+ return TVI_CONTROL_TRUE;
+ case TVI_CONTROL_TUN_SET_NORM:
+ return TVI_CONTROL_TRUE;
}
return TVI_CONTROL_UNKNOWN;
}
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index b6f77edf31..3ffd775afd 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -762,7 +762,7 @@ static int do_control(priv_t *priv, int cmd, void *arg)
case TVI_CONTROL_VID_SET_GAIN:
{
//value==0 means automatic gain control
- int value=*(int*)arg;
+ int value=*(int*)arg;
if (value < 0 || value>100)
return TVI_CONTROL_FALSE;
@@ -1407,10 +1407,10 @@ static inline void copy_frame(priv_t *priv, video_buffer_entry *dest, unsigned c
if(priv->tv_param->automute>0){
if (v4l2_ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) >= 0) {
if(priv->tv_param->automute<<8>priv->tuner.signal){
- fill_blank_frame(dest->data,dest->framesize,fcc_vl2mp(priv->format.fmt.pix.pixelformat));
- set_mute(priv,1);
- return;
- }
+ fill_blank_frame(dest->data,dest->framesize,fcc_vl2mp(priv->format.fmt.pix.pixelformat));
+ set_mute(priv,1);
+ return;
+ }
}
set_mute(priv,0);
}
diff --git a/stream/vcd_read.h b/stream/vcd_read.h
index 07b8802a0f..ccb176ff97 100644
--- a/stream/vcd_read.h
+++ b/stream/vcd_read.h
@@ -100,8 +100,8 @@ static mp_vcd_priv_t* vcd_read_toc(stream_t *stream, int fd){
tocentry.cdte_format = CDROM_MSF;
if (ioctl(fd,CDROMREADTOCENTRY,&tocentry)==-1) {
- MP_ERR(stream, "read CDROM toc entry: %s\n",strerror(errno));
- return NULL;
+ MP_ERR(stream, "read CDROM toc entry: %s\n",strerror(errno));
+ return NULL;
}
if (i<=tochdr.cdth_trk1)
@@ -155,10 +155,10 @@ static int vcd_read(mp_vcd_priv_t* vcd,char *mem){
#include <sys/scsi/generic/commands.h>
#include <sys/scsi/impl/uscsi.h>
-#define SUN_XAREAD 1 /*fails on atapi drives*/
-#define SUN_MODE2READ 2 /*fails on atapi drives*/
-#define SUN_SCSIREAD 3
-#define SUN_VCDREAD SUN_SCSIREAD
+#define SUN_XAREAD 1 /*fails on atapi drives*/
+#define SUN_MODE2READ 2 /*fails on atapi drives*/
+#define SUN_SCSIREAD 3
+#define SUN_VCDREAD SUN_SCSIREAD
static int sun_vcd_read(mp_vcd_priv_t* vcd, int *offset)
{
@@ -220,6 +220,6 @@ static int sun_vcd_read(mp_vcd_priv_t* vcd, int *offset)
#error SUN_VCDREAD
#endif
}
-#endif /*sun*/
+#endif /*sun*/
#endif /* MPLAYER_VCD_READ_H */
diff --git a/stream/vcd_read_darwin.h b/stream/vcd_read_darwin.h
index 10430a41ae..ecfe596f51 100644
--- a/stream/vcd_read_darwin.h
+++ b/stream/vcd_read_darwin.h
@@ -37,25 +37,25 @@
#include "stream.h"
//=================== VideoCD ==========================
-#define CDROM_LEADOUT 0xAA
+#define CDROM_LEADOUT 0xAA
typedef struct
{
- uint8_t sync [12];
- uint8_t header [4];
- uint8_t subheader [8];
- uint8_t data [2324];
- uint8_t spare [4];
+ uint8_t sync [12];
+ uint8_t header [4];
+ uint8_t subheader [8];
+ uint8_t data [2324];
+ uint8_t spare [4];
} cdsector_t;
typedef struct mp_vcd_priv_st
{
stream_t *stream;
- int fd;
- cdsector_t buf;
- dk_cd_read_track_info_t entry;
- struct CDDiscInfo hdr;
- CDMSF msf;
+ int fd;
+ cdsector_t buf;
+ dk_cd_read_track_info_t entry;
+ struct CDDiscInfo hdr;
+ CDMSF msf;
} mp_vcd_priv_t;
static inline void vcd_set_msf(mp_vcd_priv_t* vcd, unsigned int sect)
@@ -70,101 +70,101 @@ static inline unsigned int vcd_get_msf(mp_vcd_priv_t* vcd)
static int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
{
- struct CDTrackInfo entry;
-
- memset( &vcd->entry, 0, sizeof(vcd->entry));
- vcd->entry.addressType = kCDTrackInfoAddressTypeTrackNumber;
- vcd->entry.address = track;
- vcd->entry.bufferLength = sizeof(entry);
- vcd->entry.buffer = &entry;
-
- if (ioctl(vcd->fd, DKIOCCDREADTRACKINFO, &vcd->entry))
- {
- MP_ERR(vcd->stream, "ioctl dif1: %s\n",strerror(errno));
- return -1;
- }
- vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
- return VCD_SECTOR_DATA*vcd_get_msf(vcd);
+ struct CDTrackInfo entry;
+
+ memset( &vcd->entry, 0, sizeof(vcd->entry));
+ vcd->entry.addressType = kCDTrackInfoAddressTypeTrackNumber;
+ vcd->entry.address = track;
+ vcd->entry.bufferLength = sizeof(entry);
+ vcd->entry.buffer = &entry;
+
+ if (ioctl(vcd->fd, DKIOCCDREADTRACKINFO, &vcd->entry))
+ {
+ MP_ERR(vcd->stream, "ioctl dif1: %s\n",strerror(errno));
+ return -1;
+ }
+ vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
+ return VCD_SECTOR_DATA*vcd_get_msf(vcd);
}
static int vcd_get_track_end(mp_vcd_priv_t* vcd, int track)
{
- struct CDTrackInfo entry;
-
- if (track > vcd->hdr.lastTrackNumberInLastSessionLSB) {
- MP_ERR(vcd->stream, "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_ERR(vcd->stream, "ioctl dif2: %s\n",strerror(errno));
- return -1;
- }
- if (track == vcd->hdr.lastTrackNumberInLastSessionLSB)
- vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress) +
- be2me_32(entry.trackSize));
- else
- vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
- return VCD_SECTOR_DATA*vcd_get_msf(vcd);
+ struct CDTrackInfo entry;
+
+ if (track > vcd->hdr.lastTrackNumberInLastSessionLSB) {
+ MP_ERR(vcd->stream, "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_ERR(vcd->stream, "ioctl dif2: %s\n",strerror(errno));
+ return -1;
+ }
+ if (track == vcd->hdr.lastTrackNumberInLastSessionLSB)
+ vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress) +
+ be2me_32(entry.trackSize));
+ else
+ vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
+ return VCD_SECTOR_DATA*vcd_get_msf(vcd);
}
static mp_vcd_priv_t* vcd_read_toc(stream_t *stream, int fd)
{
- dk_cd_read_disc_info_t tochdr;
- struct CDDiscInfo hdr;
+ dk_cd_read_disc_info_t tochdr;
+ struct CDDiscInfo hdr;
- dk_cd_read_track_info_t tocentry;
- struct CDTrackInfo entry;
- CDMSF trackMSF;
+ dk_cd_read_track_info_t tocentry;
+ struct CDTrackInfo entry;
+ CDMSF trackMSF;
- mp_vcd_priv_t* vcd;
- int i;
+ mp_vcd_priv_t* vcd;
+ int i;
- //read toc header
+ //read toc header
memset(&tochdr, 0, sizeof(tochdr));
tochdr.buffer = &hdr;
tochdr.bufferLength = sizeof(hdr);
if (ioctl(fd, DKIOCCDREADDISCINFO, &tochdr) < 0)
- {
- MP_ERR(stream, "read CDROM toc header: %s\n",strerror(errno));
- return NULL;
+ {
+ MP_ERR(stream, "read CDROM toc header: %s\n",strerror(errno));
+ return NULL;
}
- //print all track info
- for (i=hdr.firstTrackNumberInLastSessionLSB ; i<=hdr.lastTrackNumberInLastSessionLSB + 1; i++)
- {
- if (i <= hdr.lastTrackNumberInLastSessionLSB) {
- memset( &tocentry, 0, sizeof(tocentry));
- tocentry.addressType = kCDTrackInfoAddressTypeTrackNumber;
- tocentry.address = i;
- tocentry.bufferLength = sizeof(entry);
- tocentry.buffer = &entry;
-
- if (ioctl(fd,DKIOCCDREADTRACKINFO,&tocentry)==-1)
- {
- MP_ERR(stream, "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_INFO(vcd->stream, "track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d\n",
- if (i<=hdr.lastTrackNumberInLastSessionLSB)
- MP_INFO(stream, "track %02d: format=%d %02d:%02d:%02d\n",
+ //print all track info
+ for (i=hdr.firstTrackNumberInLastSessionLSB ; i<=hdr.lastTrackNumberInLastSessionLSB + 1; i++)
+ {
+ if (i <= hdr.lastTrackNumberInLastSessionLSB) {
+ memset( &tocentry, 0, sizeof(tocentry));
+ tocentry.addressType = kCDTrackInfoAddressTypeTrackNumber;
+ tocentry.address = i;
+ tocentry.bufferLength = sizeof(entry);
+ tocentry.buffer = &entry;
+
+ if (ioctl(fd,DKIOCCDREADTRACKINFO,&tocentry)==-1)
+ {
+ MP_ERR(stream, "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_INFO(vcd->stream, "track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d\n",
+ if (i<=hdr.lastTrackNumberInLastSessionLSB)
+ MP_INFO(stream, "track %02d: format=%d %02d:%02d:%02d\n",
(int)tocentry.address,
//(int)tocentry.entry.addr_type,
//(int)tocentry.entry.control,
@@ -172,33 +172,33 @@ static mp_vcd_priv_t* vcd_read_toc(stream_t *stream, int fd)
(int)trackMSF.minute,
(int)trackMSF.second,
(int)trackMSF.frame
- );
+ );
- }
+ }
- vcd = malloc(sizeof(mp_vcd_priv_t));
+ vcd = malloc(sizeof(mp_vcd_priv_t));
vcd->stream = stream;
- vcd->fd = fd;
- vcd->hdr = hdr;
- vcd->msf = trackMSF;
- return vcd;
+ vcd->fd = fd;
+ vcd->hdr = hdr;
+ vcd->msf = trackMSF;
+ return vcd;
}
static int vcd_read(mp_vcd_priv_t* vcd,char *mem)
{
- if (pread(vcd->fd,&vcd->buf,VCD_SECTOR_SIZE,vcd_get_msf(vcd)*VCD_SECTOR_SIZE) != VCD_SECTOR_SIZE)
- return 0; // EOF?
-
- vcd->msf.frame++;
- if (vcd->msf.frame==75)
- {
- vcd->msf.frame=0;
- vcd->msf.second++;
-
- if (vcd->msf.second==60)
- {
- vcd->msf.second=0;
- vcd->msf.minute++;
+ if (pread(vcd->fd,&vcd->buf,VCD_SECTOR_SIZE,vcd_get_msf(vcd)*VCD_SECTOR_SIZE) != VCD_SECTOR_SIZE)
+ return 0; // EOF?
+
+ vcd->msf.frame++;
+ if (vcd->msf.frame==75)
+ {
+ vcd->msf.frame=0;
+ vcd->msf.second++;
+
+ if (vcd->msf.second==60)
+ {
+ vcd->msf.second=0;
+ vcd->msf.minute++;
}
}
diff --git a/stream/vcd_read_fbsd.h b/stream/vcd_read_fbsd.h
index fe3bb8c5ae..ffa9ae7f6d 100644
--- a/stream/vcd_read_fbsd.h
+++ b/stream/vcd_read_fbsd.h
@@ -44,14 +44,14 @@
#include "common/msg.h"
//=================== VideoCD ==========================
-#define CDROM_LEADOUT 0xAA
+#define CDROM_LEADOUT 0xAA
typedef struct {
- uint8_t sync [12];
- uint8_t header [4];
- uint8_t subheader [8];
- uint8_t data [2324];
- uint8_t spare [4];
+ uint8_t sync [12];
+ uint8_t header [4];
+ uint8_t subheader [8];
+ uint8_t data [2324];
+ uint8_t spare [4];
} cdsector_t;
#ifdef VCD_NETBSD
diff --git a/stream/vcd_read_win32.h b/stream/vcd_read_win32.h
index 7c5117db16..ac6466c2a1 100644
--- a/stream/vcd_read_win32.h
+++ b/stream/vcd_read_win32.h
@@ -49,15 +49,15 @@ static inline unsigned vcd_get_msf(mp_vcd_priv_t* vcd, int track){
int index = track - vcd->toc.FirstTrack;
/* -150 to compensate the 2-second pregap */
return vcd->toc.TrackData[index].Address[3] +
- (vcd->toc.TrackData[index].Address[2] +
- vcd->toc.TrackData[index].Address[1] * 60) * 75 - 150;
+ (vcd->toc.TrackData[index].Address[2] +
+ vcd->toc.TrackData[index].Address[1] * 60) * 75 - 150;
}
static int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
{
unsigned sect;
if (track < vcd->toc.FirstTrack || track > vcd->toc.LastTrack)
- return -1;
+ return -1;
sect = vcd_get_msf(vcd, track);
vcd_set_msf(vcd, sect);
return VCD_SECTOR_DATA * (sect + 2);
@@ -66,7 +66,7 @@ static int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
static int vcd_get_track_end(mp_vcd_priv_t* vcd, int track)
{
if (track < vcd->toc.FirstTrack || track > vcd->toc.LastTrack)
- return -1;
+ return -1;
return VCD_SECTOR_DATA * (vcd_get_msf(vcd, track + 1));
}
@@ -77,29 +77,29 @@ static mp_vcd_priv_t* vcd_read_toc(stream_t *stream, int fd)
int i;
mp_vcd_priv_t* vcd = malloc(sizeof(mp_vcd_priv_t));
if (!vcd)
- return NULL;
+ return NULL;
hd = (HANDLE)_get_osfhandle(fd);
if (!DeviceIoControl(hd, IOCTL_CDROM_READ_TOC, NULL, 0, &vcd->toc,
- sizeof(CDROM_TOC), &dwBytesReturned, NULL)) {
- MP_ERR(stream, "read CDROM toc header: %lu\n",
- GetLastError());
- free(vcd);
- return NULL;
+ sizeof(CDROM_TOC), &dwBytesReturned, NULL)) {
+ MP_ERR(stream, "read CDROM toc header: %lu\n",
+ GetLastError());
+ free(vcd);
+ return NULL;
}
for (i = vcd->toc.FirstTrack; i <= vcd->toc.LastTrack + 1; i++) {
- int index = i - vcd->toc.FirstTrack;
- if (i <= vcd->toc.LastTrack) {
- MP_INFO(stream, "track %02d: adr=%d ctrl=%d"
- " %02d:%02d:%02d\n",
- vcd->toc.TrackData[index].TrackNumber,
- vcd->toc.TrackData[index].Adr,
- vcd->toc.TrackData[index].Control,
- vcd->toc.TrackData[index].Address[1],
- vcd->toc.TrackData[index].Address[2],
- vcd->toc.TrackData[index].Address[3]);
- }
+ int index = i - vcd->toc.FirstTrack;
+ if (i <= vcd->toc.LastTrack) {
+ MP_INFO(stream, "track %02d: adr=%d ctrl=%d"
+ " %02d:%02d:%02d\n",
+ vcd->toc.TrackData[index].TrackNumber,
+ vcd->toc.TrackData[index].Adr,
+ vcd->toc.TrackData[index].Control,
+ vcd->toc.TrackData[index].Address[1],
+ vcd->toc.TrackData[index].Address[2],
+ vcd->toc.TrackData[index].Address[3]);
+ }
}
vcd->hd = hd;
@@ -119,9 +119,9 @@ static int vcd_read(mp_vcd_priv_t* vcd, char *mem)
cdrom_raw.TrackMode = XAForm2;
if (!DeviceIoControl(vcd->hd, IOCTL_CDROM_RAW_READ, &cdrom_raw,
- sizeof(RAW_READ_INFO), vcd->buf, sizeof(vcd->buf),
- &dwBytesReturned, NULL))
- return 0;
+ sizeof(RAW_READ_INFO), vcd->buf, sizeof(vcd->buf),
+ &dwBytesReturned, NULL))
+ return 0;
vcd->sect++;
memcpy(mem, &vcd->buf[VCD_SECTOR_OFFS], VCD_SECTOR_DATA);