aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/ai_alsa.c26
-rw-r--r--stream/ai_alsa1x.c32
-rw-r--r--stream/ai_oss.c20
-rw-r--r--stream/asf_mmst_streaming.c57
-rw-r--r--stream/asf_streaming.c75
-rw-r--r--stream/audio_in.c12
-rw-r--r--stream/cache2.c15
-rw-r--r--stream/cdinfo.c6
-rw-r--r--stream/network.c44
-rw-r--r--stream/network.h3
-rw-r--r--stream/open.c4
-rw-r--r--stream/pnm.c2
-rw-r--r--stream/realrtsp/asmrp.c1
-rw-r--r--stream/realrtsp/real.c2
-rw-r--r--stream/realrtsp/rmff.c2
-rw-r--r--stream/realrtsp/sdpplin.c1
-rw-r--r--stream/stream.c55
-rw-r--r--stream/stream.h33
-rw-r--r--stream/stream_cdda.c6
-rw-r--r--stream/stream_cddb.c74
-rw-r--r--stream/stream_cue.c72
-rw-r--r--stream/stream_dvd.c52
-rw-r--r--stream/stream_dvd_common.c12
-rw-r--r--stream/stream_dvdnav.c6
-rw-r--r--stream/stream_ffmpeg.c2
-rw-r--r--stream/stream_file.c4
-rw-r--r--stream/stream_live555.c2
-rw-r--r--stream/stream_nemesi.c1
-rw-r--r--stream/stream_netstream.c6
-rw-r--r--stream/stream_radio.c147
-rw-r--r--stream/stream_radio.h12
-rw-r--r--stream/stream_rtsp.c2
-rw-r--r--stream/stream_smb.c4
-rw-r--r--stream/stream_vcd.c8
-rw-r--r--stream/stream_vstream.c4
-rw-r--r--stream/tcp.c20
-rw-r--r--stream/tv.c93
-rw-r--r--stream/tvi_bsdbt848.c62
-rw-r--r--stream/tvi_dshow.c84
-rw-r--r--stream/tvi_v4l.c4
-rw-r--r--stream/url.c22
-rw-r--r--stream/vcd_read.h2
-rw-r--r--stream/vcd_read_fbsd.h2
43 files changed, 555 insertions, 538 deletions
diff --git a/stream/ai_alsa.c b/stream/ai_alsa.c
index 4371dd23ba..e913dde099 100644
--- a/stream/ai_alsa.c
+++ b/stream/ai_alsa.c
@@ -23,24 +23,24 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_hw_params_any(ai->alsa.handle, params);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_PcmBrokenConfig);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableAccessType);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableSampleFmt);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Sample format not available.\n");
return -1;
}
err = snd_pcm_hw_params_set_channels(ai->alsa.handle, params, ai->req_channels);
if (err < 0) {
ai->channels = snd_pcm_hw_params_get_channels(params);
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableChanCount,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Channel count not available - reverting to default: %d\n",
ai->channels);
} else {
ai->channels = ai->req_channels;
@@ -61,14 +61,14 @@ int ai_alsa_setup(audio_in_t *ai)
assert(ai->alsa.period_time >= 0);
err = snd_pcm_hw_params(ai->alsa.handle, params);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_CannotInstallHWParams);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to install hardware paramameters: %s");
snd_pcm_hw_params_dump(params, ai->alsa.log);
return -1;
}
ai->alsa.chunk_size = snd_pcm_hw_params_get_period_size(params, 0);
buffer_size = snd_pcm_hw_params_get_buffer_size(params);
if (ai->alsa.chunk_size == buffer_size) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_PeriodEqualsBufferSize, ai->alsa.chunk_size, (long)buffer_size);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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);
@@ -84,7 +84,7 @@ int ai_alsa_setup(audio_in_t *ai)
assert(err >= 0);
if (snd_pcm_sw_params(ai->alsa.handle, swparams) < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_CannotInstallSWParams);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to install software parameters:\n");
snd_pcm_sw_params_dump(swparams, ai->alsa.log);
return -1;
}
@@ -108,7 +108,7 @@ 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio, snd_strerror(err));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error opening audio: %s\n", snd_strerror(err));
return -1;
}
@@ -142,7 +142,7 @@ int ai_alsa_xrun(audio_in_t *ai)
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(ai->alsa.handle, status))<0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatusError, snd_strerror(res));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA status error: %s", snd_strerror(res));
return -1;
}
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) {
@@ -150,18 +150,18 @@ int ai_alsa_xrun(audio_in_t *ai)
gettimeofday(&now, 0);
snd_pcm_status_get_trigger_tstamp(status, &tstamp);
timersub(&now, &tstamp, &diff);
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaXRUN,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA xrun!!! (at least %.3f ms long)\n",
diff.tv_sec * 1000 + diff.tv_usec / 1000.0);
if (mp_msg_test(MSGT_TV, MSGL_V)) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatus);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA Status:\n");
snd_pcm_status_dump(status, ai->alsa.log);
}
if ((res = snd_pcm_prepare(ai->alsa.handle))<0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaXRUNPrepareError, snd_strerror(res));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA xrun: prepare error: %s", snd_strerror(res));
return -1;
}
return 0; /* ok, data should be accepted again */
}
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA read/write error");
return -1;
}
diff --git a/stream/ai_alsa1x.c b/stream/ai_alsa1x.c
index 23e0b5d9ef..fa307a1cd8 100644
--- a/stream/ai_alsa1x.c
+++ b/stream/ai_alsa1x.c
@@ -24,27 +24,27 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_hw_params_any(ai->alsa.handle, params);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_PcmBrokenConfig);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableAccessType);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableSampleFmt);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_UnavailableChanCount,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Channel count not available - reverting to default: %d\n",
ai->channels);
} else {
ai->channels = ai->req_channels;
@@ -54,7 +54,7 @@ int ai_alsa_setup(audio_in_t *ai)
rate = ai->req_samplerate;
err = snd_pcm_hw_params_set_rate_near(ai->alsa.handle, params, &rate, &dir);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA1X_CannotSetSamplerate);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Cannot set samplerate.\n");
}
ai->samplerate = rate;
@@ -63,7 +63,7 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_hw_params_set_buffer_time_near(ai->alsa.handle, params,
&ai->alsa.buffer_time, &dir);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA1X_CannotSetBufferTime);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Cannot set buffer time.\n");
}
dir = 0;
@@ -71,12 +71,12 @@ int ai_alsa_setup(audio_in_t *ai)
err = snd_pcm_hw_params_set_period_time_near(ai->alsa.handle, params,
&ai->alsa.period_time, &dir);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA1X_CannotSetPeriodTime);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Cannot set period time.\n");
}
err = snd_pcm_hw_params(ai->alsa.handle, params);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_CannotInstallHWParams, snd_strerror(err));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to install hardware paramameters: %s", snd_strerror(err));
snd_pcm_hw_params_dump(params, ai->alsa.log);
return -1;
}
@@ -86,7 +86,7 @@ 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_PeriodEqualsBufferSize, ai->alsa.chunk_size, (long)buffer_size);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Can't use period equal to buffer size (%u == %lu)\n", ai->alsa.chunk_size, (long)buffer_size);
return -1;
}
@@ -98,7 +98,7 @@ 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_CannotInstallSWParams);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to install software parameters:\n");
snd_pcm_sw_params_dump(swparams, ai->alsa.log);
return -1;
}
@@ -122,7 +122,7 @@ 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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio, snd_strerror(err));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error opening audio: %s\n", snd_strerror(err));
return -1;
}
@@ -156,7 +156,7 @@ int ai_alsa_xrun(audio_in_t *ai)
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(ai->alsa.handle, status))<0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatusError, snd_strerror(res));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA status error: %s", snd_strerror(res));
return -1;
}
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) {
@@ -164,18 +164,18 @@ int ai_alsa_xrun(audio_in_t *ai)
gettimeofday(&now, 0);
snd_pcm_status_get_trigger_tstamp(status, &tstamp);
timersub(&now, &tstamp, &diff);
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaXRUN,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA xrun!!! (at least %.3f ms long)\n",
diff.tv_sec * 1000 + diff.tv_usec / 1000.0);
if (mp_msg_test(MSGT_TV, MSGL_V)) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaStatus);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA Status:\n");
snd_pcm_status_dump(status, ai->alsa.log);
}
if ((res = snd_pcm_prepare(ai->alsa.handle))<0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaXRUNPrepareError, snd_strerror(res));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA xrun: prepare error: %s", snd_strerror(res));
return -1;
}
return 0; /* ok, data should be accepted again */
}
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "ALSA read/write error");
return -1;
}
diff --git a/stream/ai_oss.c b/stream/ai_oss.c
index d2d2f20163..d39454e855 100644
--- a/stream/ai_oss.c
+++ b/stream/ai_oss.c
@@ -41,7 +41,7 @@ int ai_oss_set_channels(audio_in_t *ai)
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp channels: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_CHANNELS, &ioctl_param));
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2SetChanCount,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set channel count: %d\n",
ai->req_channels);
return -1;
}
@@ -54,7 +54,7 @@ int ai_oss_set_channels(audio_in_t *ai)
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_STEREO, &ioctl_param),
ioctl_param);
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2SetStereo,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set stereo: %d\n",
ai->req_channels == 2);
return -1;
}
@@ -71,7 +71,7 @@ int ai_oss_init(audio_in_t *ai)
ai->oss.audio_fd = open(ai->oss.device, O_RDONLY);
if (ai->oss.audio_fd < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2Open,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to open '%s': %s\n",
ai->oss.device, strerror(errno));
return -1;
}
@@ -82,13 +82,13 @@ int ai_oss_init(audio_in_t *ai)
mp_msg(MSGT_TV, MSGL_V, "Supported formats: %x\n", ioctl_param);
if (!(ioctl_param & AFMT_S16_LE))
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_UnsupportedFmt);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "unsupported format\n");
ioctl_param = AFMT_S16_LE;
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp setfmt: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETFMT, &ioctl_param));
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2SetAudioFmt);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set audio format.");
return -1;
}
@@ -98,7 +98,7 @@ int ai_oss_init(audio_in_t *ai)
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp speed: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SPEED, &ioctl_param));
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2SetSamplerate,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set samplerate: %d\n",
ai->req_samplerate);
return -1;
}
@@ -111,7 +111,7 @@ int ai_oss_init(audio_in_t *ai)
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp trigger: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_SETTRIGGER, &ioctl_param));
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2SetTrigger,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set trigger: %d\n",
PCM_ENABLE_INPUT);
}
@@ -119,17 +119,17 @@ int ai_oss_init(audio_in_t *ai)
mp_msg(MSGT_TV, MSGL_V, "ioctl dsp getblocksize: %d\n",
err = ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETBLKSIZE, &ai->blocksize));
if (err < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_Unable2GetBlockSize);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to get block size!\n");
}
mp_msg(MSGT_TV, MSGL_V, "blocksize: %d\n", ai->blocksize);
// correct the blocksize to a reasonable value
if (ai->blocksize <= 0) {
ai->blocksize = 4096*ai->channels*2;
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_AudioBlockSizeZero, ai->blocksize);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIOSS_AudioBlockSize2Low, ai->blocksize);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Audio block size too low, setting to %d!\n", ai->blocksize);
}
ai->samplesize = 16;
diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c
index 6d764617a4..a32938a871 100644
--- a/stream/asf_mmst_streaming.c
+++ b/stream/asf_mmst_streaming.c
@@ -35,7 +35,7 @@
#include <inttypes.h>
#include "config.h"
-
+#include "options.h"
#include "mp_msg.h"
#include "help_mp.h"
@@ -134,7 +134,7 @@ static void send_command (int s, int command, uint32_t switches,
memset(&cmd.buf[48 + length], 0, 8 - (length & 7));
if (send (s, cmd.buf, len8*8+48, 0) != (len8*8+48)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_WriteError);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"write error\n");
}
}
@@ -182,7 +182,7 @@ static void get_answer (int s)
len = recv (s, data, BUF_SIZE, 0) ;
if (!len) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_EOFAlert);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"\nAlert! EOF\n");
return;
}
@@ -229,7 +229,7 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
while (1) {
if (!get_data (s, pre_header, 8)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_PreHeaderReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"pre-header read failed\n");
return 0;
}
if (pre_header[4] == 0x02) {
@@ -241,12 +241,12 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
// mp_msg(MSGT_NETWORK,MSGL_INFO,"asf header packet detected, len=%d\n", packet_len);
if (packet_len < 0 || packet_len > HDR_BUF_SIZE - header_len) {
- mp_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MPDEMUX_MMST_InvalidHeaderSize);
+ mp_tmsg(MSGT_NETWORK, MSGL_FATAL, "Invalid header size, giving up.\n");
return 0;
}
if (!get_data (s, &header[header_len], packet_len)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_HeaderDataReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Header data read failed.\n");
return 0;
}
@@ -272,7 +272,7 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
char data[BUF_SIZE];
if (!get_data (s, (char*)&packet_len, 4)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_packet_lenReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"packet_len read failed.\n");
return 0;
}
@@ -281,13 +281,13 @@ static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl)
// mp_msg(MSGT_NETWORK,MSGL_INFO,"command packet detected, len=%d\n", packet_len);
if (packet_len < 0 || packet_len > BUF_SIZE) {
- mp_msg(MSGT_NETWORK, MSGL_FATAL,
- MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize);
+ mp_tmsg(MSGT_NETWORK, MSGL_FATAL,
+ "Invalid RTSP packet size, giving up.\n");
return 0;
}
if (!get_data (s, data, packet_len)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_CmdDataReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Command data read failed.\n");
return 0;
}
@@ -340,14 +340,14 @@ static int interp_header (uint8_t *header, int header_len)
i += 8;
if ( (guid_1 == 0x6cce6200aa00d9a6ULL) && (guid_2 == 0x11cf668e75b22630ULL) ) {
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_HeaderObject);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"header object\n");
} else if ((guid_1 == 0x6cce6200aa00d9a6ULL) && (guid_2 == 0x11cf668e75b22636ULL)) {
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_DataObject);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"data object\n");
} else if ((guid_1 == 0x6553200cc000e48eULL) && (guid_2 == 0x11cfa9478cabdca1ULL)) {
packet_length = get_32(header, i+92-24);
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_FileObjectPacketLen,
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"file object, packet length = %d (%d)\n",
packet_length, get_32(header, i+96-24));
@@ -355,13 +355,13 @@ static int interp_header (uint8_t *header, int header_len)
int stream_id = header[i+48] | header[i+49] << 8;
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_StreamObjectStreamID, stream_id);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"stream object, stream ID: %d\n", stream_id);
if (num_stream_ids < MAX_STREAMS) {
stream_ids[num_stream_ids] = stream_id;
num_stream_ids++;
} else {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_2ManyStreamID);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Too many IDs, stream skipped.");
}
} else {
@@ -377,7 +377,7 @@ static int interp_header (uint8_t *header, int header_len)
}
printf("\n");
#else
- mp_msg(MSGT_NETWORK,MSGL_WARN,MSGTR_MPDEMUX_MMST_UnknownObject);
+ mp_tmsg(MSGT_NETWORK,MSGL_WARN,"unknown object\n");
#endif
}
@@ -397,7 +397,7 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
char data[BUF_SIZE];
if (!get_data (s, pre_header, 8)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_PreHeaderReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"pre-header read failed\n");
return 0;
}
@@ -414,12 +414,12 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
// mp_msg(MSGT_NETWORK,MSGL_INFO,"asf media packet detected, len=%d\n", packet_len);
if (packet_len < 0 || packet_len > BUF_SIZE) {
- mp_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize);
+ mp_tmsg(MSGT_NETWORK, MSGL_FATAL, "Invalid RTSP packet size, giving up.\n");
return 0;
}
if (!get_data (s, data, packet_len)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_MediaDataReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Media data read failed.\n");
return 0;
}
@@ -431,26 +431,26 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
int command;
if (!get_data (s, (char*)&packet_len, 4)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_packet_lenReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"packet_len read failed.\n");
return 0;
}
packet_len = get_32 ((unsigned char*)&packet_len, 0) + 4;
if (packet_len < 0 || packet_len > BUF_SIZE) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Invalid RTSP packet size, giving up.\n");
return 0;
}
if (!get_data (s, data, packet_len)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_CmdDataReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Command data read failed.\n");
return 0;
}
if ( (pre_header[7] != 0xb0) || (pre_header[6] != 0x0b)
|| (pre_header[5] != 0xfa) || (pre_header[4] != 0xce) ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_MissingSignature);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"missing signature\n");
return -1;
}
@@ -461,7 +461,7 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
if (command == 0x1b)
send_command (s, 0x1b, 0, 0, 0, data);
else if (command == 0x1e) {
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_PatentedTechnologyJoke);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Everything done. Thank you for downloading a media file containing proprietary and patented technology.\n");
return 0;
}
else if (command == 0x21 ) {
@@ -470,7 +470,7 @@ static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl)
return 0;
}
else if (command != 0x05) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_UnknownCmd,command);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"unknown command %02x\n",command);
return -1;
}
}
@@ -491,7 +491,7 @@ static int asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ct
// buffer is empty - fill it!
int ret = get_media_packet( fd, packet_length1, stream_ctrl);
if( ret<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_GetMediaPacketErr,strerror(errno));
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"get_media_packet error : %s\n",strerror(errno));
return -1;
} else if (ret==0) //EOF?
return ret;
@@ -544,7 +544,7 @@ int asf_mmst_streaming_start(stream_t *stream)
*/
unescpath=malloc(strlen(path)+1);
if (!unescpath) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return -1;
}
url_unescape_string(unescpath,path);
@@ -559,7 +559,7 @@ int asf_mmst_streaming_start(stream_t *stream)
free(path);
return s;
}
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_MMST_Connected);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Connected\n");
seq_num=0;
@@ -639,6 +639,7 @@ int asf_mmst_streaming_start(stream_t *stream)
memset (data, 0, 40);
+ int audio_id = stream->opts->audio_id;
if (audio_id > 0) {
data[2] = 0xFF;
data[3] = 0xFF;
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index 956f60daee..41e9087b50 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
+#include "options.h"
#if HAVE_WINSOCK2_H
#include <winsock2.h>
@@ -23,7 +24,7 @@
#include "network.h"
#include "tcp.h"
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
#include "libmpdemux/asfguid.h"
@@ -37,7 +38,7 @@ static int asf_read_wrapper(int fd, void *buffer, int len, streaming_ctrl_t *str
while (len > 0) {
int got = nop_streaming_read(fd, buf, len, stream_ctrl);
if (got <= 0) {
- mp_msg(MSGT_NETWORK, MSGL_ERR, MSGTR_MPDEMUX_ASF_ErrReadingNetworkStream);
+ mp_tmsg(MSGT_NETWORK, MSGL_ERR, "Error while reading network stream.\n");
return got;
}
buf += got;
@@ -108,11 +109,11 @@ printf("0x%02X\n", stream_chunck->type );
if( drop_packet!=NULL ) *drop_packet = 0;
if( stream_chunck->size<8 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_StreamChunkSize2Small, stream_chunck->size);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Ahhhh, stream_chunck size is too small: %d\n", stream_chunck->size);
return -1;
}
if( stream_chunck->size!=stream_chunck->size_confirm ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_SizeConfirmMismatch, stream_chunck->size, stream_chunck->size_confirm);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"size_confirm mismatch!: %d %d\n", stream_chunck->size, stream_chunck->size_confirm);
return -1;
}
/*
@@ -145,9 +146,6 @@ printf("0x%02X\n", stream_chunck->type );
return stream_chunck->size+4;
}
-extern int audio_id;
-extern int video_id;
-
static void close_s(stream_t *stream) {
closesocket(stream->fd);
stream->fd=-1;
@@ -187,13 +185,13 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
// Endian handling of the stream chunk
le2me_ASF_stream_chunck_t(&chunk);
size = asf_streaming( &chunk, &r) - sizeof(ASF_stream_chunck_t);
- if(r) mp_msg(MSGT_NETWORK,MSGL_WARN,MSGTR_MPDEMUX_ASF_WarnDropHeader);
+ if(r) mp_tmsg(MSGT_NETWORK,MSGL_WARN,"Warning: drop header ????\n");
if(size < 0){
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrorParsingChunkHeader);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error while parsing chunk header\n");
return -1;
}
if (chunk.type != ASF_STREAMING_HEADER) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_NoHeaderAtFirstChunk);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Didn't get a header as first chunk !!!!\n");
return -1;
}
@@ -201,7 +199,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
if (size > SIZE_MAX - buffer_size) return -1;
buffer = malloc(size+buffer_size);
if(buffer == NULL) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MPDEMUX_ASF_BufferMallocFailed,size+buffer_size);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Error: Can't allocate %d bytes buffer.\n",size+buffer_size);
return -1;
}
if( chunk_buffer!=NULL ) {
@@ -218,7 +216,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
if( chunk_size2read==0 ) {
ASF_header_t *asfh = (ASF_header_t *)buffer;
if(size < (int)sizeof(ASF_header_t)) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrChunk2Small);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error: Chunk is too small.\n");
return -1;
} else mp_msg(MSGT_NETWORK,MSGL_DBG2,"Got chunk\n");
chunk_size2read = AV_RL64(&asfh->objh.size);
@@ -359,34 +357,34 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
free(a_rates);
if (a_idx < 0 && v_idx < 0) {
- mp_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MPDEMUX_ASF_Bandwidth2SmallCannotPlay);
+ mp_tmsg(MSGT_NETWORK, MSGL_FATAL, "Bandwidth too small, file cannot be played!\n");
return -1;
}
- if (audio_id > 0)
+ if (*streaming_ctrl->audio_id_ptr > 0)
// a audio stream was forced
- asf_ctrl->audio_id = audio_id;
+ asf_ctrl->audio_id = *streaming_ctrl->audio_id_ptr;
else if (a_idx >= 0)
asf_ctrl->audio_id = asf_ctrl->audio_streams[a_idx];
else if (asf_ctrl->n_audio) {
- mp_msg(MSGT_NETWORK, MSGL_WARN, MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedAudio);
- audio_id = -2;
+ mp_tmsg(MSGT_NETWORK, MSGL_WARN, "Bandwidth too small, deselected audio stream.\n");
+ *streaming_ctrl->audio_id_ptr = -2;
}
- if (video_id > 0)
+ if (*streaming_ctrl->video_id_ptr > 0)
// a video stream was forced
- asf_ctrl->video_id = video_id;
+ asf_ctrl->video_id = *streaming_ctrl->video_id_ptr;
else if (v_idx >= 0)
asf_ctrl->video_id = asf_ctrl->video_streams[v_idx];
else if (asf_ctrl->n_video) {
- mp_msg(MSGT_NETWORK, MSGL_WARN, MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedVideo);
- video_id = -2;
+ mp_tmsg(MSGT_NETWORK, MSGL_WARN, "Bandwidth too small, deselected video stream.\n");
+ *streaming_ctrl->video_id_ptr = -2;
}
return 1;
len_err_out:
- mp_msg(MSGT_NETWORK, MSGL_FATAL, MSGTR_MPDEMUX_ASF_InvalidLenInHeader);
+ mp_tmsg(MSGT_NETWORK, MSGL_FATAL, "Invalid length in ASF header!\n");
if (buffer) free(buffer);
if (v_rates) free(v_rates);
if (a_rates) free(a_rates);
@@ -408,14 +406,14 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct
le2me_ASF_stream_chunck_t(&chunk);
chunk_size = asf_streaming( &chunk, &drop_chunk );
if(chunk_size < 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrorParsingChunkHeader);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error while parsing chunk header\n");
return -1;
}
chunk_size -= sizeof(ASF_stream_chunck_t);
if(chunk.type != ASF_STREAMING_HEADER && (!drop_chunk)) {
if (asf_http_ctrl->packet_size < chunk_size) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrChunkBiggerThanPacket);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error: chunk_size > packet_size\n");
return -1;
}
waiting = asf_http_ctrl->packet_size;
@@ -508,7 +506,7 @@ static int asf_http_streaming_type(char *content_type, char *features, HTTP_head
(!strcasecmp(content_type, "video/x-ms-afs")) ||
(!strcasecmp(content_type, "video/x-ms-wmv")) ||
(!strcasecmp(content_type, "video/x-ms-wma")) ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ASFRedirector);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"=====> ASF Redirector\n");
return ASF_Redirector_e;
} else if( !strcasecmp(content_type, "text/plain") ) {
mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Plain text\n");
@@ -550,7 +548,7 @@ static HTTP_header_t *asf_http_request(streaming_ctrl_t *streaming_ctrl) {
if( !strcasecmp( url->protocol, "http_proxy" ) ) {
server_url = url_new( (url->file)+1 );
if( server_url==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_InvalidProxyURL);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"invalid proxy URL\n");
http_free( http_hdr );
return NULL;
}
@@ -611,7 +609,7 @@ static HTTP_header_t *asf_http_request(streaming_ctrl_t *streaming_ctrl) {
// First request goes here.
break;
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_UnknownASFStreamType);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"unknown ASF stream type\n");
}
http_set_field( http_hdr, "Connection: Close" );
@@ -625,7 +623,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT
char features[64] = "\0";
size_t len;
if( http_response_parse(http_hdr)<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_Failed2ParseHTTPResponse);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Failed to parse HTTP response.\n");
return -1;
}
switch( http_hdr->status_code ) {
@@ -634,7 +632,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT
case 401: // Authentication required
return ASF_Authenticate_e;
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ServerReturn, http_hdr->status_code, http_hdr->reason_phrase);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Server returned %d:%s\n", http_hdr->status_code, http_hdr->reason_phrase);
return -1;
}
@@ -658,7 +656,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT
len = (unsigned int)(end-pragma);
}
if(len > sizeof(features) - 1) {
- mp_msg(MSGT_NETWORK,MSGL_WARN,MSGTR_MPDEMUX_ASF_ASFHTTPParseWarnCuttedPragma,pragma,len,sizeof(features) - 1);
+ mp_tmsg(MSGT_NETWORK,MSGL_WARN,"ASF HTTP PARSE WARNING : Pragma %s cut from %d bytes to %d\n",pragma,len,sizeof(features) - 1);
len = sizeof(features) - 1;
}
strncpy( features, pragma, len );
@@ -689,7 +687,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
asf_http_ctrl = malloc(sizeof(asf_http_streaming_ctrl_t));
if( asf_http_ctrl==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return -1;
}
asf_http_ctrl->streaming_type = ASF_Unknown_e;
@@ -715,7 +713,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
for(i=0; i < (int)http_hdr->buffer_size ; ) {
int r = send( fd, http_hdr->buffer+i, http_hdr->buffer_size-i, 0 );
if(r <0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_SocketWriteError,strerror(errno));
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"socket write error: %s\n",strerror(errno));
goto err_out;
}
i += r;
@@ -737,7 +735,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
}
ret = asf_http_parse_response(asf_http_ctrl, http_hdr);
if( ret<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_HeaderParseFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Failed to parse header.\n");
goto err_out;
}
switch( asf_http_ctrl->streaming_type ) {
@@ -755,7 +753,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
ret = asf_streaming_parse_header(fd,stream->streaming_ctrl);
if(ret < 0) goto err_out;
if(asf_http_ctrl->n_audio == 0 && asf_http_ctrl->n_video == 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_NoStreamFound);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"No stream found.\n");
goto err_out;
}
asf_http_ctrl->request++;
@@ -781,7 +779,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
break;
case ASF_Unknown_e:
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_UnknownASFStreamingType);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"unknown ASF streaming type\n");
goto err_out;
}
// Check if we got a redirect.
@@ -817,12 +815,14 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
if( stream->streaming_ctrl==NULL ) {
return STREAM_ERROR;
}
+ stream->streaming_ctrl->audio_id_ptr = &stream->opts->audio_id;
+ stream->streaming_ctrl->video_id_ptr = &stream->opts->video_id;
stream->streaming_ctrl->bandwidth = network_bandwidth;
url = url_new(stream->url);
stream->streaming_ctrl->url = check4proxies(url);
url_free(url);
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_MPDEMUX_ASF_InfoStreamASFURL, stream->url);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "STREAM_ASF, URL: %s\n", stream->url);
if((!strncmp(stream->url, "http", 4)) && (*file_format!=DEMUXER_TYPE_ASF && *file_format!=DEMUXER_TYPE_UNKNOWN)) {
streaming_ctrl_free(stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
@@ -830,7 +830,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
if(asf_streaming_start(stream, file_format) < 0) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_ASF_StreamingFailed);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed, exiting.\n");
streaming_ctrl_free(stream->streaming_ctrl);
stream->streaming_ctrl = NULL;
return STREAM_UNSUPPORTED;
@@ -853,4 +853,3 @@ const stream_info_t stream_info_asf = {
NULL,
0 // Urls are an option string
};
-
diff --git a/stream/audio_in.c b/stream/audio_in.c
index 93513e9604..99b5ccf7fb 100644
--- a/stream/audio_in.c
+++ b/stream/audio_in.c
@@ -185,16 +185,16 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
if (ret != ai->alsa.chunk_size) {
if (ret < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio, snd_strerror(ret));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "\nError reading audio: %s\n", snd_strerror(ret));
if (ret == -EPIPE) {
if (ai_alsa_xrun(ai) == 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_XRUNSomeFramesMayBeLeftOut);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Recovered from cross-run, some frames may be left out!\n");
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrFatalCannotRecover);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Fatal error, cannot recover!\n");
}
}
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_NotEnoughSamples);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "\nNot enough audio samples!\n");
}
return -1;
}
@@ -205,9 +205,9 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
if (ret != ai->blocksize) {
if (ret < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "\nError reading audio: %s\n", strerror(errno));
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_NotEnoughSamples);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "\nNot enough audio samples!\n");
}
return -1;
}
diff --git a/stream/cache2.c b/stream/cache2.c
index fcef566762..057f3b803c 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -38,10 +38,6 @@ static void *ThreadProc(void *s);
#include "stream.h"
#include "cache2.h"
-extern int use_gui;
-
-int stream_fill_buffer(stream_t *s);
-int stream_seek_long(stream_t *s,off_t pos);
typedef struct {
// constats:
@@ -75,13 +71,13 @@ static int min_fill=0;
int cache_fill_status=0;
-void cache_stats(cache_vars_t* s){
+static void cache_stats(cache_vars_t* s){
int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X [0x%06X] 0x%06X ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %% (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
}
-int cache_read(cache_vars_t* s,unsigned char* buf,int size){
+static int cache_read(cache_vars_t* s,unsigned char* buf,int size){
int total=0;
while(size>0){
int pos,newb,len;
@@ -127,7 +123,7 @@ int cache_read(cache_vars_t* s,unsigned char* buf,int size){
return total;
}
-int cache_fill(cache_vars_t* s){
+static int cache_fill(cache_vars_t* s){
int back,back2,newb,space,len,pos;
off_t read=s->read_filepos;
@@ -372,7 +368,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
mp_msg(MSGT_CACHE,MSGL_V,"CACHE_PRE_INIT: %"PRId64" [%"PRId64"] %"PRId64" pre:%d eof:%d \n",
(int64_t)s->min_filepos,(int64_t)s->read_filepos,(int64_t)s->max_filepos,min,s->eof);
while(s->read_filepos<s->min_filepos || s->max_filepos-s->read_filepos<min){
- mp_msg(MSGT_CACHE,MSGL_STATUS,MSGTR_CacheFill,
+ mp_tmsg(MSGT_CACHE,MSGL_STATUS,"\rCache fill: %5.2f%% (%"PRId64" bytes) ",
100.0*(float)(s->max_filepos-s->read_filepos)/(float)(s->buffer_size),
(int64_t)s->max_filepos-s->read_filepos
);
@@ -399,9 +395,6 @@ static void ThreadProc( void *s ){
#endif
#endif
-#ifdef CONFIG_GUI
- use_gui = 0; // mp_msg may not use gui stuff in forked code
-#endif
// cache thread mainloop:
signal(SIGTERM,exit_sighandler); // kill
do {
diff --git a/stream/cdinfo.c b/stream/cdinfo.c
index 6e4544d366..4da80c71a1 100644
--- a/stream/cdinfo.c
+++ b/stream/cdinfo.c
@@ -25,7 +25,7 @@ cd_info_new(void) {
cd_info = malloc(sizeof(cd_info_t));
if( cd_info==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Memory allocation failed.\n");
return NULL;
}
@@ -59,14 +59,14 @@ cd_info_add_track(cd_info_t *cd_info, char *track_name, unsigned int track_nb, u
cd_track = malloc(sizeof(cd_track_t));
if( cd_track==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Memory allocation failed.\n");
return NULL;
}
memset(cd_track, 0, sizeof(cd_track_t));
cd_track->name = malloc(strlen(track_name)+1);
if( cd_track->name==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Memory allocation failed.\n");
free(cd_track);
return NULL;
}
diff --git a/stream/network.c b/stream/network.c
index 801bebaf24..15a0a9ba84 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -98,7 +98,7 @@ streaming_ctrl_new(void) {
streaming_ctrl_t *streaming_ctrl;
streaming_ctrl = malloc(sizeof(streaming_ctrl_t));
if( streaming_ctrl==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return NULL;
}
memset( streaming_ctrl, 0, sizeof(streaming_ctrl_t) );
@@ -135,15 +135,15 @@ check4proxies( URL_t *url ) {
URL_t *proxy_url = url_new( proxy );
if( proxy_url==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_WARN,
- MSGTR_MPDEMUX_NW_InvalidProxySettingTryingWithout);
+ mp_tmsg(MSGT_NETWORK,MSGL_WARN,
+ "Invalid proxy setting... Trying without proxy.\n");
return url_out;
}
#ifdef HAVE_AF_INET6
if (network_ipv4_only_proxy && (gethostbyname(url->hostname)==NULL)) {
- mp_msg(MSGT_NETWORK,MSGL_WARN,
- MSGTR_MPDEMUX_NW_CantResolvTryingWithoutProxy);
+ mp_tmsg(MSGT_NETWORK,MSGL_WARN,
+ "Could not resolve remote hostname for AF_INET. Trying without proxy.\n");
url_free(proxy_url);
return url_out;
}
@@ -153,7 +153,7 @@ check4proxies( URL_t *url ) {
len = strlen( proxy_url->hostname ) + strlen( url->url ) + 20; // 20 = http_proxy:// + port
new_url = malloc( len+1 );
if( new_url==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
url_free(proxy_url);
return url_out;
}
@@ -238,7 +238,7 @@ http_send_request( URL_t *url, off_t pos ) {
ret = send( fd, http_hdr->buffer, http_hdr->buffer_size, 0 );
if( ret!=(int)http_hdr->buffer_size ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ErrSendingHTTPRequest);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error while sending HTTP request: Didn't send all the request.\n");
goto err_out;
}
@@ -267,12 +267,12 @@ http_read_response( int fd ) {
do {
i = recv( fd, response, BUFFER_SIZE, 0 );
if( i<0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ReadFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Read failed.\n");
http_free( http_hdr );
return NULL;
}
if( i==0 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_Read0CouldBeEOF);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"http_read_response read 0 (i.e. EOF).\n");
http_free( http_hdr );
return NULL;
}
@@ -286,8 +286,14 @@ int
http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry) {
char *aut;
+#define MPDEMUX_NW_AuthFailed _(\
+"Authentication failed. Please use the -user and -passwd options to provide your\n"\
+"username/password for a list of URLs, or form an URL like:\n"\
+"http://username:password@hostname/file\n")
+
+
if( *auth_retry==1 ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_AuthFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,MPDEMUX_NW_AuthFailed);
return -1;
}
if( *auth_retry>0 ) {
@@ -306,28 +312,28 @@ http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry) {
char *aut_space;
aut_space = strstr(aut, "realm=");
if( aut_space!=NULL ) aut_space += 6;
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_AuthRequiredFor, aut_space);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Authentication required for %s\n", aut_space);
} else {
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_AuthRequired);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Authentication required.\n");
}
if( network_username ) {
url->username = strdup(network_username);
if( url->username==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return -1;
}
} else {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_AuthFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,MPDEMUX_NW_AuthFailed);
return -1;
}
if( network_password ) {
url->password = strdup(network_password);
if( url->password==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return -1;
}
} else {
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_NoPasswdProvidedTryingBlank);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"No password provided, trying blank password.\n");
}
(*auth_retry)++;
return 0;
@@ -360,7 +366,7 @@ http_seek( stream_t *stream, off_t pos ) {
}
break;
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ErrServerReturned, http_hdr->status_code, http_hdr->reason_phrase );
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Server returns %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase );
close( fd );
fd = -1;
}
@@ -382,7 +388,7 @@ streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size) {
//printf("streaming_bufferize\n");
streaming_ctrl->buffer = malloc(size);
if( streaming_ctrl->buffer==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
return -1;
}
memcpy( streaming_ctrl->buffer, buffer, size );
@@ -442,7 +448,7 @@ void fixup_network_stream_cache(stream_t *stream) {
stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5;
if( stream_cache_size<64 ) stream_cache_size = 64; // 16KBytes min buffer
}
- mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_CacheSizeSetTo, stream_cache_size);
+ mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Cache size set to %d KBytes\n", stream_cache_size);
}
}
diff --git a/stream/network.h b/stream/network.h
index bc4ec598ef..c00bffd5e5 100644
--- a/stream/network.h
+++ b/stream/network.h
@@ -53,6 +53,9 @@ typedef struct streaming_control {
int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
void *data;
+ // hacks for asf
+ int *audio_id_ptr;
+ int *video_id_ptr;
} streaming_ctrl_t;
//int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url );
diff --git a/stream/open.c b/stream/open.c
index 5ef0a9e3ff..6a16275fd3 100644
--- a/stream/open.c
+++ b/stream/open.c
@@ -30,7 +30,8 @@ int dvd_title=0;
// Open a new stream (stdin/file/vcd/url)
-stream_t* open_stream(char* filename,char** options, int* file_format){
+stream_t* open_stream(char* filename, struct MPOpts *options, int* file_format)
+{
// Check if playlist or unknown
if (*file_format != DEMUXER_TYPE_PLAYLIST){
*file_format=DEMUXER_TYPE_UNKNOWN;
@@ -45,4 +46,3 @@ if(!filename) {
return open_stream_full(filename,STREAM_READ,options,file_format);
}
-
diff --git a/stream/pnm.c b/stream/pnm.c
index 650aeb40cb..e211a67f8d 100644
--- a/stream/pnm.c
+++ b/stream/pnm.c
@@ -43,7 +43,7 @@
#include <winsock2.h>
#endif
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
#include "stream.h"
#include "libmpdemux/demuxer.h"
diff --git a/stream/realrtsp/asmrp.c b/stream/realrtsp/asmrp.c
index 699f14c159..bcbe1c9389 100644
--- a/stream/realrtsp/asmrp.c
+++ b/stream/realrtsp/asmrp.c
@@ -688,4 +688,3 @@ int asmrp_match (const char *rules, int bandwidth, int *matches) {
return num_matches;
}
-
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index 0206833301..cad231dedd 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -37,7 +37,7 @@
#include "sdpplin.h"
#include "xbuffer.h"
#include "libavutil/md5.h"
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
#include "stream/http.h"
#include "mp_msg.h"
diff --git a/stream/realrtsp/rmff.c b/stream/realrtsp/rmff.c
index 3221df9dad..e147b76f36 100644
--- a/stream/realrtsp/rmff.c
+++ b/stream/realrtsp/rmff.c
@@ -29,7 +29,7 @@
#include "rmff.h"
#include "xbuffer.h"
#include "mp_msg.h"
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
/*
#define LOG
diff --git a/stream/realrtsp/sdpplin.c b/stream/realrtsp/sdpplin.c
index 9669b085fd..fe561f4082 100644
--- a/stream/realrtsp/sdpplin.c
+++ b/stream/realrtsp/sdpplin.c
@@ -394,4 +394,3 @@ void sdpplin_free(sdpplin_t *description) {
free(description);
}
-
diff --git a/stream/stream.c b/stream/stream.c
index 819b04d9f6..76d4306b82 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -32,7 +32,9 @@
//#include "vcd_read_bincue.h"
-static int (*stream_check_interrupt_cb)(int time) = NULL;
+struct input_ctx;
+static int (*stream_check_interrupt_cb)(struct input_ctx *ctx, int time);
+static struct input_ctx *stream_check_interrupt_ctx;
extern const stream_info_t stream_info_vcd;
extern const stream_info_t stream_info_cdda;
@@ -123,9 +125,11 @@ static const stream_info_t* const auto_open_streams[] = {
NULL
};
-stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode,
- char** options, int* file_format, int* ret,
- char** redirected_url) {
+static stream_t *open_stream_plugin(const stream_info_t *sinfo, char *filename,
+ int mode, struct MPOpts *options,
+ int *file_format, int *ret,
+ char **redirected_url)
+{
void* arg = NULL;
stream_t* s;
m_struct_t* desc = (m_struct_t*)sinfo->opts;
@@ -142,18 +146,9 @@ stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode,
return NULL;
}
}
- if(options) {
- int i;
- for(i = 0 ; options[i] != NULL ; i += 2) {
- mp_msg(MSGT_OPEN,MSGL_DBG2, "Set stream arg %s=%s\n",
- options[i],options[i+1]);
- if(!m_struct_set(desc,arg,options[i],options[i+1]))
- mp_msg(MSGT_OPEN,MSGL_WARN, "Failed to set stream option %s=%s\n",
- options[i],options[i+1]);
- }
- }
}
s = new_stream(-2,-2);
+ s->opts = options;
s->url=strdup(filename);
s->flags |= mode;
*ret = sinfo->open(s,mode,arg,file_format);
@@ -190,7 +185,9 @@ stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode,
}
-stream_t* open_stream_full(char* filename,int mode, char** options, int* file_format) {
+stream_t *open_stream_full(char *filename,int mode, struct MPOpts *options,
+ int* file_format)
+{
int i,j,l,r;
const stream_info_t* sinfo;
stream_t* s;
@@ -220,7 +217,7 @@ stream_t* open_stream_full(char* filename,int mode, char** options, int* file_fo
return s;
}
else if(r != STREAM_UNSUPPORTED) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_FailedToOpen,filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Failed to open %s.\n",filename);
return NULL;
}
break;
@@ -232,7 +229,8 @@ stream_t* open_stream_full(char* filename,int mode, char** options, int* file_fo
return NULL;
}
-stream_t* open_output_stream(char* filename,char** options) {
+stream_t *open_output_stream(char *filename, struct MPOpts *options)
+{
int file_format; //unused
if(!filename) {
mp_msg(MSGT_OPEN,MSGL_ERR,"open_output_stream(), NULL filename, report this bug\n");
@@ -357,18 +355,22 @@ if(newpos==0 || newpos!=s->pos){
// putchar('%');fflush(stdout);
}
-while(stream_fill_buffer(s) > 0 && pos >= 0) {
+s->eof = 0; // EOF reset when seek succeeds.
+while (stream_fill_buffer(s) > 0) {
if(pos<=s->buf_len){
s->buf_pos=pos; // byte position in sector
return 1;
}
pos -= s->buf_len;
}
-
-// if(pos==s->buf_len) printf("XXX Seek to last byte of file -> EOF\n");
-
- mp_msg(MSGT_STREAM,MSGL_V,"stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n",(int64_t)(pos+newpos));
- return 0;
+// Fill failed, but seek still is a success.
+s->pos += pos;
+s->buf_pos = 0;
+s->buf_len = 0;
+
+mp_msg(MSGT_STREAM,MSGL_V,
+ "stream_seek: Seek to/past EOF: no buffer preloaded.\n");
+return 1;
}
@@ -461,11 +463,14 @@ stream_t* new_ds_stream(demux_stream_t *ds) {
return s;
}
-void stream_set_interrupt_callback(int (*cb)(int)) {
+void stream_set_interrupt_callback(int (*cb)(struct input_ctx *, int),
+ struct input_ctx *ctx)
+{
stream_check_interrupt_cb = cb;
+ stream_check_interrupt_ctx = ctx;
}
int stream_check_interrupt(int time) {
if(!stream_check_interrupt_cb) return 0;
- return stream_check_interrupt_cb(time);
+ return stream_check_interrupt_cb(stream_check_interrupt_ctx, time);
}
diff --git a/stream/stream.h b/stream/stream.h
index 1270553a00..135be37b69 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -75,7 +75,7 @@
#include "network.h"
#endif
-struct stream_st;
+struct stream;
typedef struct stream_info_st {
const char *info;
const char *name;
@@ -84,7 +84,7 @@ typedef struct stream_info_st {
/// mode isn't used atm (ie always READ) but it shouldn't be ignored
/// opts is at least in it's defaults settings and may have been
/// altered by url parsing if enabled and the options string parsing.
- int (*open)(struct stream_st* st, int mode, void* opts, int* file_format);
+ int (*open)(struct stream* st, int mode, void* opts, int* file_format);
const char* protocols[MAX_STREAM_PROTOCOLS];
const void* opts;
int opts_url; /* If this is 1 we will parse the url as an option string
@@ -92,19 +92,19 @@ typedef struct stream_info_st {
* options string given to open_stream_plugin */
} stream_info_t;
-typedef struct stream_st {
+typedef struct stream {
// Read
- int (*fill_buffer)(struct stream_st *s, char* buffer, int max_len);
+ int (*fill_buffer)(struct stream *s, char* buffer, int max_len);
// Write
- int (*write_buffer)(struct stream_st *s, char* buffer, int len);
+ int (*write_buffer)(struct stream *s, char* buffer, int len);
// Seek
- int (*seek)(struct stream_st *s,off_t pos);
+ int (*seek)(struct stream *s,off_t pos);
// Control
// Will be later used to let streams like dvd and cdda report
// their structure (ie tracks, chapters, etc)
- int (*control)(struct stream_st *s,int cmd,void* arg);
+ int (*control)(struct stream *s,int cmd,void* arg);
// Close
- void (*close)(struct stream_st *s);
+ void (*close)(struct stream *s);
int fd; // file descriptor, see man open(2)
int type; // see STREAMTYPE_*
@@ -118,20 +118,21 @@ typedef struct stream_st {
void* cache_data;
void* priv; // used for DVD, TV, RTSP etc
char* url; // strdup() of filename/url
+ struct MPOpts *opts;
#ifdef CONFIG_NETWORK
streaming_ctrl_t *streaming_ctrl;
#endif
unsigned char buffer[STREAM_BUFFER_SIZE>VCD_SECTOR_SIZE?STREAM_BUFFER_SIZE:VCD_SECTOR_SIZE];
} stream_t;
+int stream_fill_buffer(stream_t *s);
+int stream_seek_long(stream_t *s,off_t pos);
#ifdef CONFIG_STREAM_CACHE
int stream_enable_cache(stream_t *stream,int size,int min,int prefill);
int cache_stream_fill_buffer(stream_t *s);
int cache_stream_seek_long(stream_t *s,off_t pos);
#else
// no cache, define wrappers:
-int stream_fill_buffer(stream_t *s);
-int stream_seek_long(stream_t *s,off_t pos);
#define cache_stream_fill_buffer(x) stream_fill_buffer(x)
#define cache_stream_seek_long(x,y) stream_seek_long(x,y)
#define stream_enable_cache(x,y,z,w) 1
@@ -268,6 +269,7 @@ inline static int stream_seek(stream_t *s,off_t pos){
off_t x=pos-(s->pos-s->buf_len);
if(x>=0){
s->buf_pos=x;
+ s->eof = 0;
// putchar('*');fflush(stdout);
return 1;
}
@@ -294,17 +296,20 @@ inline static int stream_skip(stream_t *s,off_t len){
return 1;
}
+struct MPOpts;
void stream_reset(stream_t *s);
int stream_control(stream_t *s, int cmd, void *arg);
stream_t* new_stream(int fd,int type);
void free_stream(stream_t *s);
stream_t* new_memory_stream(unsigned char* data,int len);
-stream_t* open_stream(char* filename,char** options,int* file_format);
-stream_t* open_stream_full(char* filename,int mode, char** options, int* file_format);
-stream_t* open_output_stream(char* filename,char** options);
+stream_t* open_stream(char* filename, struct MPOpts *options,int* file_format);
+stream_t* open_stream_full(char* filename,int mode, struct MPOpts *options, int* file_format);
+stream_t* open_output_stream(char* filename,struct MPOpts *options);
/// Set the callback to be used by libstream to check for user
/// interruption during long blocking operations (cache filling, etc).
-void stream_set_interrupt_callback(int (*cb)(int));
+struct input_ctx;
+void stream_set_interrupt_callback(int (*cb)(struct input_ctx*, int),
+ struct input_ctx *ctx);
/// Call the interrupt checking callback if there is one.
int stream_check_interrupt(int time);
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 12063e53d8..707a5d9a51 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -195,7 +195,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
#endif
if(!cdd) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_MPDEMUX_CDDA_CantOpenCDDADevice);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Can't open CDDA device.\n");
m_struct_free(&stream_opts,opts);
free(cddb_info);
return STREAM_ERROR;
@@ -211,7 +211,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
}
if(cdda_open(cdd) != 0) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_MPDEMUX_CDDA_CantOpenDisc);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Can't open disc.\n");
cdda_close(cdd);
m_struct_free(&stream_opts,opts);
free(cddb_info);
@@ -219,7 +219,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
}
cd_info = cd_info_new();
- mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_MPDEMUX_CDDA_AudioCDFoundWithNTracks,cdda_tracks(cdd));
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,"Found audio CD with %ld tracks.\n",cdda_tracks(cdd));
for(i=0;i<cdd->tracks;i++) {
char track_name[80];
long sec=cdda_track_firstsector(cdd,i+1);
diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
index 3a51cbc2ec..22e9eb9ad3 100644
--- a/stream/stream_cddb.c
+++ b/stream/stream_cddb.c
@@ -82,7 +82,7 @@ read_toc(const char *dev) {
drive = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
if(!DeviceIoControl(drive, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(CDROM_TOC), &r, 0)) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToReadTOC);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed to read TOC.\n");
return 0;
}
@@ -219,7 +219,7 @@ int cdd_identify(const char *dev)
int i, min, sec, frame;
cdtoc_last_track = read_toc(dev);
if (cdtoc_last_track < 0) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToOpenDevice, dev);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed to open %s device.\n", dev);
return -1;
}
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_CDDA_TRACKS=%d\n", cdtoc_last_track);
@@ -278,19 +278,19 @@ cddb_http_request(char *command, int (*reply_parser)(HTTP_header_t*,cddb_data_t*
url = url_new(request);
if( url==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NotAValidURL);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "not a valid URL\n");
return -1;
}
fd = http_send_request(url,0);
if( fd<0 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToSendHTTPRequest);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Failed to send the HTTP request.\n");
return -1;
}
http_hdr = http_read_response( fd );
if( http_hdr==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToReadHTTPResponse);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Failed to read the HTTP response.\n");
return -1;
}
@@ -302,10 +302,10 @@ cddb_http_request(char *command, int (*reply_parser)(HTTP_header_t*,cddb_data_t*
ret = reply_parser(http_hdr, cddb_data);
break;
case 400:
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_HTTPErrorNOTFOUND);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Not Found.\n");
break;
default:
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_HTTPErrorUnknown);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "unknown error code\n");
}
http_free( http_hdr );
@@ -331,7 +331,7 @@ cddb_read_cache(cddb_data_t *cddb_data) {
#endif
);
if( file_fd<0 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NoCacheFound);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "No cache found.\n");
return -1;
}
@@ -345,13 +345,13 @@ cddb_read_cache(cddb_data_t *cddb_data) {
cddb_data->xmcd_file = malloc(file_size+1);
if( cddb_data->xmcd_file==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Memory allocation failed.\n");
close(file_fd);
return -1;
}
cddb_data->xmcd_file_size = read(file_fd, cddb_data->xmcd_file, file_size);
if( cddb_data->xmcd_file_size!=file_size ) {
- mp_msg(MSGT_DEMUX, MSGL_WARN, MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenRead);
+ mp_tmsg(MSGT_DEMUX, MSGL_WARN, "Not all the xmcd file has been read.\n");
close(file_fd);
return -1;
}
@@ -383,7 +383,7 @@ cddb_write_cache(cddb_data_t *cddb_data) {
if( ret<0 ) {
#endif
perror("mkdir");
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToCreateDirectory, cddb_data->cache_dir);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Failed to create directory %s.\n", cddb_data->cache_dir);
return -1;
}
}
@@ -403,7 +403,7 @@ cddb_write_cache(cddb_data_t *cddb_data) {
return -1;
}
if( (unsigned int)wrote!=cddb_data->xmcd_file_size ) {
- mp_msg(MSGT_DEMUX, MSGL_WARN, MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenWritten);
+ mp_tmsg(MSGT_DEMUX, MSGL_WARN, "Not all of the xmcd file has been written.\n");
close(file_fd);
return -1;
}
@@ -424,7 +424,7 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
@@ -432,13 +432,13 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
case 210:
ret = sscanf( http_hdr->body, "%d %99s %08lx", &status, category, &disc_id);
if( ret!=3 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
// Check if it's a xmcd database file
ptr = strstr(http_hdr->body, "# xmcd");
if( ptr==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_InvalidXMCDDatabaseReturned);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Invalid xmcd database file returned.\n");
return -1;
}
ptr = strdup(ptr);
@@ -455,7 +455,7 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
// Ok found the end
// do a sanity check
if( http_hdr->body_size<(unsigned int)(ptr2-ptr) ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_UnexpectedFIXME);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "unexpected FIXME\n");
return -1;
}
cddb_data->xmcd_file = ptr;
@@ -463,7 +463,7 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
cddb_data->xmcd_file[cddb_data->xmcd_file_size] = '\0';
return cddb_write_cache(cddb_data);
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "unhandled code\n");
}
return 0;
}
@@ -483,7 +483,7 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ptr = strstr(http_hdr->body, "\n");
if( ptr==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_UnableToFindEOL);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Unable to find end of line.\n");
return -1;
}
ptr++;
@@ -491,7 +491,7 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
// So let's take the first one.
ret = sscanf(ptr, "%99s %08lx %99s", cddb_data->category, &(cddb_data->disc_id), album_title);
if( ret!=3 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
ptr = strstr(http_hdr->body, album_title);
@@ -508,7 +508,7 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
strncpy(album_title, ptr, len);
album_title[len]='\0';
}
- mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title);
+ mp_tmsg(MSGT_DEMUX, MSGL_STATUS, "Parse OK, found: %s\n", album_title);
return 0;
}
@@ -520,7 +520,7 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
@@ -529,7 +529,7 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
// Found exact match
ret = sscanf(http_hdr->body, "%d %99s %08lx %99s", &status, cddb_data->category, &(cddb_data->disc_id), album_title);
if( ret!=4 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
ptr = strstr(http_hdr->body, album_title);
@@ -546,11 +546,11 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
strncpy(album_title, ptr, len);
album_title[len]='\0';
}
- mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title);
+ mp_tmsg(MSGT_DEMUX, MSGL_STATUS, "Parse OK, found: %s\n", album_title);
return cddb_request_titles(cddb_data);
case 202:
// No match found
- mp_msg(MSGT_DEMUX, MSGL_WARN, MSGTR_MPDEMUX_CDDB_AlbumNotFound);
+ mp_tmsg(MSGT_DEMUX, MSGL_WARN, "Album not found.\n");
break;
case 210:
// Found exact matches, list follows
@@ -568,10 +568,10 @@ blues c711930d Santana / Supernatural
cddb_parse_matches_list(http_hdr, cddb_data);
return cddb_request_titles(cddb_data);
case 500:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_ServerReturnsCommandSyntaxErr);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "Server returns: Command syntax error\n");
break;
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "unhandled code\n");
}
return -1;
}
@@ -584,7 +584,7 @@ cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
@@ -592,18 +592,18 @@ cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
case 210:
ptr = strstr(http_hdr->body, "max proto:");
if( ptr==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
ret = sscanf(ptr, "max proto: %d", &max);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
cddb_data->freedb_proto_level = max;
return 0;
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "unhandled code\n");
}
return -1;
}
@@ -619,7 +619,7 @@ cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ret = sscanf( http_hdr->body, "%d ", &status);
if( ret!=1 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "parse error");
return -1;
}
@@ -629,10 +629,10 @@ cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ret = cddb_data->anonymous; // For gcc complaining about unused parameter.
return 0;
case 401:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_NoSitesInfoAvailable);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "No sites information available.\n");
break;
default:
- mp_msg(MSGT_DEMUX, MSGL_FIXME, MSGTR_MPDEMUX_CDDB_UnhandledCode);
+ mp_tmsg(MSGT_DEMUX, MSGL_FIXME, "unhandled code\n");
}
return -1;
}
@@ -685,7 +685,7 @@ cddb_retrieve(cddb_data_t *cddb_data) {
cddb_create_hello(cddb_data);
if( cddb_get_proto_level(cddb_data)<0 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToGetProtocolLevel);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Failed to get the protocol level.\n");
return -1;
}
@@ -711,7 +711,7 @@ cddb_resolve(const char *dev, char **xmcd_file) {
{
cdtoc_last_track = read_toc(dev);
if (cdtoc_last_track < 0) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToOpenDevice, dev);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed to open %s device.\n", dev);
return -1;
}
}
@@ -724,7 +724,7 @@ cddb_resolve(const char *dev, char **xmcd_file) {
// Check if there is a CD in the drive
// FIXME: That's not really a good way to check
if( cddb_data.disc_id==0 ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NoCDInDrive);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "No CD in the drive.\n");
return -1;
}
@@ -740,7 +740,7 @@ cddb_resolve(const char *dev, char **xmcd_file) {
} else {
cddb_data.cache_dir = malloc(strlen(home_dir)+strlen(cddb_cache_dir)+1);
if( cddb_data.cache_dir==NULL ) {
- mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_DEMUX, MSGL_ERR, "Memory allocation failed.\n");
return -1;
}
sprintf(cddb_data.cache_dir, "%s%s", home_dir, cddb_cache_dir );
diff --git a/stream/stream_cue.c b/stream/stream_cue.c
index 53cb01299b..fe36b22d51 100644
--- a/stream/stream_cue.c
+++ b/stream/stream_cue.c
@@ -147,8 +147,8 @@ static int cue_getTrackinfo(char *Line, tTrack *track)
}
else if (strncmp(&Line[4], "PREGAP ", 7)==0) { ; /* ignore */ }
else if (strncmp(&Line[4], "FLAGS ", 6)==0) { ; /* ignore */ }
- else mp_msg (MSGT_OPEN,MSGL_INFO,
- MSGTR_MPDEMUX_CUEREAD_UnexpectedCuefileLine, Line);
+ else mp_tmsg (MSGT_OPEN,MSGL_INFO,
+ "[bincue] Unexpected cuefile line: %s\n", Line);
}
return 0;
}
@@ -199,7 +199,7 @@ static int cue_find_bin (char *firstline) {
fd_bin = open (bin_filename, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_MPDEMUX_CUEREAD_BinFilenameTested,
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS, "[bincue] bin filename tested: %s\n",
bin_filename);
/* now try to find it with the path of the cue file */
@@ -207,8 +207,8 @@ static int cue_find_bin (char *firstline) {
fd_bin = open (s, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS,
- MSGTR_MPDEMUX_CUEREAD_BinFilenameTested, s);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,
+ "[bincue] bin filename tested: %s\n", s);
/* now I would say the whole filename is shit, build our own */
strncpy(s, cue_filename, strlen(cue_filename) - 3 );
s[strlen(cue_filename) - 3] = '\0';
@@ -216,16 +216,16 @@ static int cue_find_bin (char *firstline) {
fd_bin = open (s, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS,
- MSGTR_MPDEMUX_CUEREAD_BinFilenameTested, s);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,
+ "[bincue] bin filename tested: %s\n", s);
/* ok try it with path */
snprintf(t, sizeof( t ), "%s/%s", bincue_path, s);
fd_bin = open (t, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS,
- MSGTR_MPDEMUX_CUEREAD_BinFilenameTested,t);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,
+ "[bincue] bin filename tested: %s\n",t);
/* now I would say the whole filename is shit, build our own */
strncpy(s, cue_filename, strlen(cue_filename) - 3 );
s[strlen(cue_filename) - 3] = '\0';
@@ -233,19 +233,19 @@ static int cue_find_bin (char *firstline) {
fd_bin = open (s, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS,
- MSGTR_MPDEMUX_CUEREAD_BinFilenameTested, s);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,
+ "[bincue] bin filename tested: %s\n", s);
/* ok try it with path */
snprintf(t, sizeof( t ), "%s/%s", bincue_path, s);
fd_bin = open (t, O_RDONLY);
if (fd_bin == -1)
{
- mp_msg(MSGT_OPEN,MSGL_STATUS,
- MSGTR_MPDEMUX_CUEREAD_BinFilenameTested, s);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,
+ "[bincue] bin filename tested: %s\n", s);
/* I'll give up */
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_CannotFindBinFile);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Couldn't find the bin file - giving up.\n");
return -1;
}
}
@@ -257,8 +257,8 @@ static int cue_find_bin (char *firstline) {
}
- mp_msg(MSGT_OPEN,MSGL_INFO,
- MSGTR_MPDEMUX_CUEREAD_UsingBinFile, bin_filename);
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,
+ "[bincue] Using bin file %s.\n", bin_filename);
return 0;
}
@@ -291,8 +291,8 @@ static inline int cue_mode_2_sector_size(int mode)
case MODE2_2336: return SIZEISO_MODE2_FORM2;
default:
- mp_msg(MSGT_OPEN,MSGL_FATAL,
- MSGTR_MPDEMUX_CUEREAD_UnknownModeForBinfile);
+ mp_tmsg(MSGT_OPEN,MSGL_FATAL,
+ "[bincue] unknown mode for binfile. Should not happen. Aborting.\n");
abort();
}
@@ -342,8 +342,8 @@ static int cue_read_cue (char *in_cue_filename)
fd_cue = fopen (in_cue_filename, "r");
if (fd_cue == NULL)
{
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_CannotOpenCueFile, in_cue_filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Cannot open %s.\n", in_cue_filename);
return -1;
}
@@ -352,8 +352,8 @@ static int cue_read_cue (char *in_cue_filename)
if(! fgets( sLine, 256, fd_cue ) )
{
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_ErrReadingFromCueFile, in_cue_filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Error reading from %s\n", in_cue_filename);
fclose (fd_cue);
return -1;
}
@@ -368,8 +368,8 @@ static int cue_read_cue (char *in_cue_filename)
/* red the next line and call our track finder */
if(! fgets( sLine, 256, fd_cue ) )
{
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_ErrReadingFromCueFile, in_cue_filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Error reading from %s\n", in_cue_filename);
fclose (fd_cue);
return -1;
}
@@ -378,8 +378,8 @@ static int cue_read_cue (char *in_cue_filename)
{
if (cue_getTrackinfo(sLine, &tracks[nTracks++]) != 0)
{
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_ErrReadingFromCueFile, in_cue_filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Error reading from %s\n", in_cue_filename);
fclose (fd_cue);
return -1;
}
@@ -387,8 +387,8 @@ static int cue_read_cue (char *in_cue_filename)
/* make a fake track with stands for the Lead out */
if (fstat (fd_bin, &filestat) == -1) {
- mp_msg(MSGT_OPEN,MSGL_ERR,
- MSGTR_MPDEMUX_CUEREAD_ErrGettingBinFileSize);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,
+ "[bincue] Error getting size of bin file.\n");
fclose (fd_cue);
return -1;
}
@@ -482,8 +482,8 @@ static void cue_vcd_read_toc(void){
int i;
for (i = 0; i < nTracks; ++i) {
- mp_msg(MSGT_OPEN,MSGL_INFO,
- MSGTR_MPDEMUX_CUEREAD_InfoTrackFormat,
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,
+ "track %02d: format=%d %02d:%02d:%02d\n",
i+1,
tracks[i].mode,
tracks[i].minute,
@@ -509,12 +509,12 @@ static int cue_vcd_read(stream_t *stream, char *mem, int size) {
return 0;
if(lseek(fd_bin, position+VCD_SECTOR_OFFS, SEEK_SET) == -1) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_MPDEMUX_CUEREAD_UnexpectedBinFileEOF);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "[bincue] unexpected end of bin file\n");
return 0;
}
if(read(fd_bin, mem, VCD_SECTOR_DATA) != VCD_SECTOR_DATA) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_MPDEMUX_CUEREAD_CannotReadNBytesOfPayload, VCD_SECTOR_DATA);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "[bincue] Couldn't read %d bytes of payload.\n", VCD_SECTOR_DATA);
return 0;
}
@@ -570,10 +570,11 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
ret2=cue_vcd_get_track_end(track);
ret=cue_vcd_seek_to_track(track);
if(ret<0){
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");
+ mp_msg(MSGT_OPEN, MSGL_ERR, "%s (seek)\n",
+ mp_gtext("Error selecting VCD track."));
return STREAM_UNSUPPORTED;
}
- mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_MPDEMUX_CUEREAD_CueStreamInfo_FilenameTrackTracksavail, filename, track, ret, ret2);
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,"CUE stream_open, filename=%s, track=%d, available tracks: %d -> %d\n", filename, track, ret, ret2);
stream->fd = f;
stream->type = STREAMTYPE_VCDBINCUE;
@@ -599,4 +600,3 @@ const stream_info_t stream_info_cue = {
&stream_opts,
1 // Urls are an option string
};
-
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index a9b377a340..b5894c6c13 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -79,26 +79,26 @@ int dvd_parse_chapter_range(const m_option_t *conf, const char *range) {
if(*range && isdigit(*range)) {
dvd_chapter = strtol(range, &s, 10);
if(range == s) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
return M_OPT_INVALID;
}
}
if(*s == 0)
return 0;
else if(*s != '-') {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
return M_OPT_INVALID;
}
++s;
if(*s == 0)
return 0;
if(! isdigit(*s)) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
return M_OPT_INVALID;
}
dvd_last_chapter = strtol(s, &t, 10);
if (s == t || *t) {
- mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_DVDinvalidChapterRange, range);
+ mp_tmsg(MSGT_OPEN, MSGL_ERR, "Invalid chapter range specification %s\n", range);
return M_OPT_INVALID;
}
return 0;
@@ -154,7 +154,7 @@ int dvd_aid_from_lang(stream_t *stream, unsigned char* lang) {
code=lang[1]|(lang[0]<<8);
for(i=0;i<d->nr_of_channels;i++) {
if(d->audio_streams[i].language==code) {
- mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_DVDaudioChannel,
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,"Selected DVD audio channel: %d language: %c%c\n",
d->audio_streams[i].id, lang[0],lang[1]);
return d->audio_streams[i].id;
}
@@ -162,7 +162,7 @@ int dvd_aid_from_lang(stream_t *stream, unsigned char* lang) {
}
lang+=2; while (lang[0]==',' || lang[0]==' ') ++lang;
}
- mp_msg(MSGT_OPEN,MSGL_WARN,MSGTR_DVDnoMatchingAudio);
+ mp_tmsg(MSGT_OPEN,MSGL_WARN,"No matching DVD audio language found!\n");
}
return -1;
}
@@ -197,14 +197,14 @@ int dvd_sid_from_lang(stream_t *stream, unsigned char* lang) {
code=lang[1]|(lang[0]<<8);
for(i=0;i<d->nr_of_subtitles;i++) {
if(d->subtitles[i].language==code) {
- mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_DVDsubtitleChannel, i, lang[0],lang[1]);
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,"Selected DVD subtitle channel: %d language: %c%c\n", i, lang[0],lang[1]);
return d->subtitles[i].id;
}
}
lang+=2;
while (lang[0]==',' || lang[0]==' ') ++lang;
}
- mp_msg(MSGT_OPEN,MSGL_WARN,MSGTR_DVDnoMatchingSubtitle);
+ mp_tmsg(MSGT_OPEN,MSGL_WARN,"No matching DVD subtitle language found!\n");
return -1;
}
@@ -233,7 +233,7 @@ static int dvd_next_cell(dvd_priv_t *d) {
return next_cell;
}
-int dvd_read_sector(dvd_priv_t *d,unsigned char* data) {
+static int dvd_read_sector(dvd_priv_t *d,unsigned char* data) {
int len;
if(d->packs_left==0) {
@@ -353,7 +353,7 @@ read_next:
return d->cur_pack-1;
}
-void dvd_seek(dvd_priv_t *d,int pos) {
+static void dvd_seek(dvd_priv_t *d,int pos) {
d->packs_left=-1;
d->cur_pack=pos;
@@ -391,7 +391,7 @@ void dvd_seek(dvd_priv_t *d,int pos) {
d->angle_seek=1;
}
-void dvd_close(dvd_priv_t *d) {
+static void dvd_close(dvd_priv_t *d) {
ifoClose(d->vts_file);
ifoClose(d->vmg_file);
DVDCloseFile(d->title);
@@ -722,12 +722,12 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
snprintf(temp_device, len, "/dev/rdisk%d", i);
dvd = DVDOpen(temp_device);
if(!dvd) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,temp_device, strerror(errno));
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Couldn't open DVD device: %s (%s)\n",temp_device, strerror(errno));
} else {
#if DVDREAD_VERSION <= LIBDVDREAD_VERSION(0,9,4)
dvd_file_t *dvdfile = DVDOpenFile(dvd,dvd_title,DVD_READ_INFO_FILE);
if(!dvdfile) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,temp_device, strerror(errno));
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Couldn't open DVD device: %s (%s)\n",temp_device, strerror(errno));
DVDClose(dvd);
continue;
}
@@ -747,7 +747,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
{
dvd = DVDOpen(dvd_device_current);
if(!dvd) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,dvd_device_current, strerror(errno));
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Couldn't open DVD device: %s (%s)\n",dvd_device_current, strerror(errno));
m_struct_free(&stream_opts,opts);
return STREAM_UNSUPPORTED;
}
@@ -761,7 +761,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
*/
vmg_file = ifoOpen(dvd, 0);
if(!vmg_file) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoVMG);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Can't open VMG info!\n");
DVDClose( dvd );
m_struct_free(&stream_opts,opts);
return STREAM_UNSUPPORTED;
@@ -798,9 +798,9 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
/**
* Make sure our title number is valid.
*/
- mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_DVDnumTitles, tt_srpt->nr_of_srpts );
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS, "There are %d titles on this DVD.\n", tt_srpt->nr_of_srpts );
if(dvd_title < 1 || dvd_title > tt_srpt->nr_of_srpts) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidTitle, dvd_title);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Invalid DVD title number: %d\n", dvd_title);
ifoClose( vmg_file );
DVDClose( dvd );
m_struct_free(&stream_opts,opts);
@@ -811,9 +811,9 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
/**
* Make sure the angle number is valid for this title.
*/
- mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_DVDnumAngles, tt_srpt->title[dvd_title].nr_of_angles);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS, "There are %d angles in this DVD title.\n", tt_srpt->title[dvd_title].nr_of_angles);
if(dvd_angle<1 || dvd_angle>tt_srpt->title[dvd_title].nr_of_angles) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidAngle, dvd_angle);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Invalid DVD angle number: %d\n", dvd_angle);
goto fail;
}
--dvd_angle; // remap 1.. -> 0..
@@ -824,7 +824,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
*/
vts_file = ifoOpen( dvd, tt_srpt->title[dvd_title].title_set_nr );
if(!vts_file) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoIFO, tt_srpt->title[dvd_title].title_set_nr );
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Cannot open the IFO file for DVD title %d.\n", tt_srpt->title[dvd_title].title_set_nr );
goto fail;
}
/**
@@ -832,7 +832,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
*/
title = DVDOpenFile(dvd, tt_srpt->title[dvd_title].title_set_nr, DVD_READ_TITLE_VOBS);
if(!title) {
- mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoVOBs, tt_srpt->title[dvd_title].title_set_nr);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR, "Cannot open title VOBS (VTS_%02d_1.VOB).\n", tt_srpt->title[dvd_title].title_set_nr);
ifoClose( vts_file );
goto fail;
}
@@ -892,7 +892,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
// 1 - stereo
// 5 - 5.1
audio_stream->channels=audio->channels;
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDaudioStreamInfo,
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,"audio stream: %d format: %s (%s) language: %s aid: %d.\n",
d->nr_of_channels,
dvd_audio_stream_types[ audio->audio_format ],
dvd_audio_stream_channels[ audio->channels ],
@@ -906,7 +906,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
d->nr_of_channels++;
}
}
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDnumAudioChannels,d->nr_of_channels );
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,"number of audio channels on disk: %d.\n",d->nr_of_channels );
}
/**
@@ -938,13 +938,13 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
else if(video->display_aspect_ratio == 3) /* 16:9 */
sub_stream->id = pgc->subp_control[i] >> 8 & 31;
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, sub_stream->id, tmp);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,"subtitle ( sid ): %d language: %s\n", sub_stream->id, tmp);
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sub_stream->id);
if(language && tmp[0])
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", sub_stream->id, tmp);
d->nr_of_subtitles++;
}
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDnumSubtitles,d->nr_of_subtitles);
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,"number of subtitles on disk: %d\n",d->nr_of_subtitles);
}
/**
@@ -996,7 +996,7 @@ fail:
m_struct_free(&stream_opts, opts);
return STREAM_UNSUPPORTED;
}
- mp_msg(MSGT_DVD,MSGL_ERR,MSGTR_NoDVDSupport);
+ mp_tmsg(MSGT_DVD,MSGL_ERR,"MPlayer was compiled without DVD support, exiting.\n");
m_struct_free(&stream_opts,opts);
return STREAM_UNSUPPORTED;
}
diff --git a/stream/stream_dvd_common.c b/stream/stream_dvd_common.c
index 9e4da0955d..d5c4cc14a6 100644
--- a/stream/stream_dvd_common.c
+++ b/stream/stream_dvd_common.c
@@ -20,7 +20,7 @@
#include "mp_msg.h"
#include "help_mp.h"
#include "stream_dvd_common.h"
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
const char * const dvd_audio_stream_types[8] = { "ac3","unknown","mpeg1","mpeg2ext","lpcm","unknown","dts" };
const char * const dvd_audio_stream_channels[6] = { "mono", "stereo", "unknown", "unknown", "5.1/6.1", "5.1" };
@@ -47,13 +47,13 @@ void dvd_set_speed(char *device, unsigned speed)
return;
case -1: /* restore default value */
if (dvd_speed == 0) return; /* we haven't touched the speed setting */
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDrestoreSpeed);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "Restoring DVD speed... ");
break;
default: /* limit to <speed> KB/s */
// speed < 100 is multiple of DVD single speed (1350KB/s)
if (speed < 100)
speed *= 1350;
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitSpeed, speed);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "Limiting DVD speed to %dKB/s... ", speed);
break;
}
@@ -86,14 +86,14 @@ void dvd_set_speed(char *device, unsigned speed)
fd = open(device, O_RDWR | O_NONBLOCK);
if (fd == -1) {
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDspeedCantOpen);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "Couldn't open DVD device for writing, changing DVD speed needs write access.\n");
return;
}
if (ioctl(fd, SG_IO, &sghdr) < 0)
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitFail);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "failed\n");
else
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitOk);
+ mp_tmsg(MSGT_OPEN, MSGL_INFO, "successful\n");
close(fd);
#endif
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 1d74504fa5..117b918260 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -541,7 +541,7 @@ static void show_audio_subs_languages(dvdnav_t *nav)
if(format == 0xFFFF || format > 6)
format = 1; //unknown
id = i + base[format];
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDaudioStreamInfo, i,
+ mp_tmsg(MSGT_OPEN,MSGL_STATUS,"audio stream: %d format: %s (%s) language: %s aid: %d.\n", i,
dvd_audio_stream_types[format], dvd_audio_stream_channels[channels], tmp, id);
if (lang != 0xFFFF && lang && tmp[0])
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", id, tmp);
@@ -559,7 +559,7 @@ static void show_audio_subs_languages(dvdnav_t *nav)
tmp[1] = lang & 0xFF;
tmp[2] = 0;
}
- mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, lg, tmp);
+ mp_msg(MSGT_OPEN,MSGL_STATUS,"subtitle ( sid ): %d language: %s\n", lg, tmp);
if (lang != 0xFFFF && lang && tmp[0])
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", lg, tmp);
}
@@ -574,7 +574,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
else if(dvd_device) filename= dvd_device;
else filename = DEFAULT_DVD_DEVICE;
if(!(priv=new_dvdnav_stream(filename))) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,filename, strerror(errno));
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Couldn't open DVD device: %s (%s)\n",filename, strerror(errno));
return STREAM_UNSUPPORTED;
}
diff --git a/stream/stream_ffmpeg.c b/stream/stream_ffmpeg.c
index 6aee8c63ee..1f10793511 100644
--- a/stream/stream_ffmpeg.c
+++ b/stream/stream_ffmpeg.c
@@ -9,7 +9,7 @@
static int fill_buffer(stream_t *s, char *buffer, int max_len)
{
- int r = url_read_complete(s->priv, buffer, max_len);
+ int r = url_read(s->priv, buffer, max_len);
return (r <= 0) ? -1 : r;
}
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 9a4d7a3500..e0b7780c5f 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -126,7 +126,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
if(!strcmp(filename,"-")){
if(mode == STREAM_READ) {
// read from stdin
- mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN);
+ mp_tmsg(MSGT_OPEN,MSGL_INFO,"Reading from stdin...\n");
f=0; // 0=stdin
#if defined(__MINGW32__) || defined(__OS2__)
setmode(fileno(stdin),O_BINARY);
@@ -145,7 +145,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
#endif
f=open(filename,m, openmode);
if(f<0) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"File not found: '%s'\n",filename);
m_struct_free(&stream_opts,opts);
return STREAM_ERROR;
}
diff --git a/stream/stream_live555.c b/stream/stream_live555.c
index 8165899e94..c3b61de5d4 100644
--- a/stream/stream_live555.c
+++ b/stream/stream_live555.c
@@ -68,7 +68,7 @@ static int open_live_sdp(stream_t *stream,int mode, void* opts, int* file_format
f = open(filename,O_RDONLY);
#endif
if(f < 0) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"File not found: '%s'\n",filename);
return STREAM_ERROR;
}
diff --git a/stream/stream_nemesi.c b/stream/stream_nemesi.c
index 8333ba75ba..7cc4ccafa5 100644
--- a/stream/stream_nemesi.c
+++ b/stream/stream_nemesi.c
@@ -77,4 +77,3 @@ const stream_info_t stream_info_rtsp = {
NULL,
0 /* Urls are an option string */
};
-
diff --git a/stream/stream_netstream.c b/stream/stream_netstream.c
index c0a80689df..47d1baad89 100644
--- a/stream/stream_netstream.c
+++ b/stream/stream_netstream.c
@@ -201,7 +201,7 @@ static int seek(stream_t *s,off_t newpos) {
return 1;
}
-static int net_stream_reset(struct stream_st *s) {
+static int net_stream_reset(struct stream *s) {
mp_net_stream_packet_t* pack;
pack = send_net_stream_cmd(s,NET_STREAM_RESET,NULL,0);
@@ -212,7 +212,7 @@ static int net_stream_reset(struct stream_st *s) {
return 1;
}
-static int control(struct stream_st *s,int cmd,void* arg) {
+static int control(struct stream *s,int cmd,void* arg) {
switch(cmd) {
case STREAM_CTRL_RESET:
return net_stream_reset(s);
@@ -220,7 +220,7 @@ static int control(struct stream_st *s,int cmd,void* arg) {
return STREAM_UNSUPPORTED;
}
-static void close_s(struct stream_st *s) {
+static void close_s(struct stream *s) {
mp_net_stream_packet_t* pack;
pack = send_net_stream_cmd(s,NET_STREAM_CLOSE,NULL,0);
diff --git a/stream/stream_radio.c b/stream/stream_radio.c
index 49d75090a9..d25187f17b 100644
--- a/stream/stream_radio.c
+++ b/stream/stream_radio.c
@@ -155,7 +155,7 @@ static const struct m_struct_st stream_opts = {
stream_opts_fields
};
-static void close_s(struct stream_st * stream);
+static void close_s(struct stream *stream);
#ifdef CONFIG_RADIO_CAPTURE
static int clear_buffer(radio_priv_t* priv);
#endif
@@ -183,7 +183,7 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){
/*parsing channels string*/
channels=priv->radio_param->channels;
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_ChannelNamesDetected);
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Radio channel names detected.\n");
priv->radio_channel_list = malloc(sizeof(radio_channels_t));
priv->radio_channel_list->index=1;
priv->radio_channel_list->next=NULL;
@@ -201,7 +201,7 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){
priv->radio_channel_current->freq=atof(tmp);
if ((priv->radio_channel_current->freq>priv->rangehigh)||(priv->radio_channel_current->freq<priv->rangelow))
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_WrongFreqForChannel,
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Wrong frequency for channel %s\n",
priv->radio_channel_current->name);
while ((sep=strchr(priv->radio_channel_current->name, '_'))) sep[0] = ' ';
@@ -227,17 +227,17 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){
priv->radio_channel_current = priv->radio_channel_current->next;
if (priv->radio_channel_current->index!=channel){
if (((float)((int)freq_channel))!=freq_channel)
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_WrongChannelNumberFloat,freq_channel);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Wrong channel number: %.2f\n",freq_channel);
else
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_WrongChannelNumberInt,(int)freq_channel);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Wrong channel number: %d\n",(int)freq_channel);
return STREAM_ERROR;
}
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_SelectedChannel, priv->radio_channel_current->index,
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Selected channel: %d - %s (freq: %.2f)\n", priv->radio_channel_current->index,
priv->radio_channel_current->name, priv->radio_channel_current->freq);
*pfreq=priv->radio_channel_current->freq;
}else{
if (freq_channel){
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_FreqParameterDetected);
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Radio frequency parameter detected.\n");
priv->radio_channel_list=malloc(sizeof(radio_channels_t));
priv->radio_channel_list->next=NULL;
priv->radio_channel_list->prev=NULL;
@@ -248,7 +248,7 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){
*pfreq=freq_channel;
}
}
- mp_msg(MSGT_RADIO, MSGL_DBG2, MSGTR_RADIO_DoneParsingChannels);
+ mp_tmsg(MSGT_RADIO, MSGL_DBG2, "[radio] Done parsing channels.\n");
return STREAM_OK;
}
@@ -271,25 +271,25 @@ static int init_frac_v4l2(radio_priv_t* priv){
memset(&tuner,0,sizeof(tuner));
tuner.index=0;
if (ioctl(priv->radio_fd, VIDIOC_G_TUNER, &tuner)<0){
- mp_msg(MSGT_RADIO,MSGL_WARN,MSGTR_RADIO_GetTunerFailed,strerror(errno),priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] Warning: ioctl get tuner failed: %s. Setting frac to %d.\n",strerror(errno),priv->frac);
return STREAM_ERROR;
}
if(tuner.type!=V4L2_TUNER_RADIO){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_NotRadioDevice,priv->radio_param->device);
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] %s is no radio device!\n",priv->radio_param->device);
return STREAM_ERROR;
}
if(tuner.capability & V4L2_TUNER_CAP_LOW){
priv->frac=16000;
- mp_msg(MSGT_RADIO,MSGL_DBG2,MSGTR_RADIO_TunerCapLowYes,priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_DBG2,"[radio] tuner is low:yes frac=%d\n",priv->frac);
}
else{
priv->frac=16;
- mp_msg(MSGT_RADIO,MSGL_DBG2,MSGTR_RADIO_TunerCapLowNo,priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_DBG2,"[radio] tuner is low:no frac=%d\n",priv->frac);
}
priv->rangelow=((float)tuner.rangelow)/priv->frac;
priv->rangehigh=((float)tuner.rangehigh)/priv->frac;
- mp_msg(MSGT_RADIO,MSGL_V,MSGTR_RADIO_FreqRange,priv->rangelow,priv->rangehigh);
+ mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Allowed frequency range is %.2f-%.2f MHz.\n",priv->rangelow,priv->rangehigh);
return STREAM_OK;
}
@@ -306,7 +306,7 @@ static int set_frequency_v4l2(radio_priv_t* priv,float frequency){
freq.type=V4L2_TUNER_RADIO;
freq.frequency=frequency*priv->frac;
if(ioctl(priv->radio_fd,VIDIOC_S_FREQUENCY,&freq)<0){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_SetFreqFailed,freq.frequency,
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n",freq.frequency,
frequency,strerror(errno));
return STREAM_ERROR;
}
@@ -322,7 +322,7 @@ static int get_frequency_v4l2(radio_priv_t* priv,float* frequency){
struct v4l2_frequency freq;
memset(&freq,0,sizeof(freq));
if (ioctl(priv->radio_fd, VIDIOC_G_FREQUENCY, &freq) < 0) {
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_GetFreqFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get frequency failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
*frequency=((float)freq.frequency)/priv->frac;
@@ -346,13 +346,13 @@ static void set_volume_v4l2(radio_priv_t* priv,int volume){
control.id=V4L2_CID_AUDIO_MUTE;
control.value = (volume==0?1:0);
if (ioctl(priv->radio_fd, VIDIOC_S_CTRL, &control)<0){
- mp_msg(MSGT_RADIO,MSGL_WARN,MSGTR_RADIO_SetMuteFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] ioctl set mute failed: %s\n",strerror(errno));
}
memset(&qctrl,0,sizeof(qctrl));
qctrl.id = V4L2_CID_AUDIO_VOLUME;
if (ioctl(priv->radio_fd, VIDIOC_QUERYCTRL, &qctrl) < 0) {
- mp_msg(MSGT_RADIO, MSGL_WARN, MSGTR_RADIO_QueryControlFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_WARN, "[radio] ioctl query control failed: %s\n",strerror(errno));
return;
}
@@ -360,7 +360,7 @@ static void set_volume_v4l2(radio_priv_t* priv,int volume){
control.id=V4L2_CID_AUDIO_VOLUME;
control.value=qctrl.minimum+volume*(qctrl.maximum-qctrl.minimum)/100;
if (ioctl(priv->radio_fd, VIDIOC_S_CTRL, &control) < 0) {
- mp_msg(MSGT_RADIO, MSGL_WARN,MSGTR_RADIO_SetVolumeFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_WARN,"[radio] ioctl set volume failed: %s\n",strerror(errno));
}
}
@@ -376,14 +376,14 @@ static int get_volume_v4l2(radio_priv_t* priv,int* volume){
memset(&qctrl,0,sizeof(qctrl));
qctrl.id = V4L2_CID_AUDIO_VOLUME;
if (ioctl(priv->radio_fd, VIDIOC_QUERYCTRL, &qctrl) < 0) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_QueryControlFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] ioctl query control failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
memset(&control,0,sizeof(control));
control.id=V4L2_CID_AUDIO_VOLUME;
if (ioctl(priv->radio_fd, VIDIOC_G_CTRL, &control) < 0) {
- mp_msg(MSGT_RADIO, MSGL_ERR,MSGTR_RADIO_GetVolumeFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR,"[radio] ioctl get volume failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
@@ -402,7 +402,7 @@ static int get_volume_v4l2(radio_priv_t* priv,int* volume){
/* v4l2 driver info structure */
static const radio_driver_t radio_driver_v4l2={
"v4l2",
- MSGTR_RADIO_DriverV4L2,
+ _("[radio] Using V4Lv1 radio interface.\n")2,
init_frac_v4l2,
set_volume_v4l2,
get_volume_v4l2,
@@ -428,20 +428,20 @@ static int init_frac_v4l(radio_priv_t* priv){
struct video_tuner tuner;
memset(&tuner,0,sizeof(tuner));
if (ioctl(priv->radio_fd, VIDIOCGTUNER, &tuner) <0){
- mp_msg(MSGT_RADIO,MSGL_WARN,MSGTR_RADIO_GetTunerFailed,strerror(errno),priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] Warning: ioctl get tuner failed: %s. Setting frac to %d.\n",strerror(errno),priv->frac);
return STREAM_ERROR;
}
if(tuner.flags & VIDEO_TUNER_LOW){
priv->frac=16000;
- mp_msg(MSGT_RADIO,MSGL_DBG2,MSGTR_RADIO_TunerCapLowYes,priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_DBG2,"[radio] tuner is low:yes frac=%d\n",priv->frac);
}else{
priv->frac=16;
- mp_msg(MSGT_RADIO,MSGL_DBG2,MSGTR_RADIO_TunerCapLowNo,priv->frac);
+ mp_tmsg(MSGT_RADIO,MSGL_DBG2,"[radio] tuner is low:no frac=%d\n",priv->frac);
}
priv->rangelow=((float)tuner.rangelow)/priv->frac;
priv->rangehigh=((float)tuner.rangehigh)/priv->frac;
- mp_msg(MSGT_RADIO,MSGL_V,MSGTR_RADIO_FreqRange,priv->rangelow,priv->rangehigh);
+ mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Allowed frequency range is %.2f-%.2f MHz.\n",priv->rangelow,priv->rangehigh);
return STREAM_OK;
}
@@ -455,7 +455,7 @@ static int set_frequency_v4l(radio_priv_t* priv,float frequency){
__u32 freq;
freq=frequency*priv->frac;
if (ioctl(priv->radio_fd, VIDIOCSFREQ, &freq) < 0) {
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_SetFreqFailed,freq,frequency,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n",freq,frequency,strerror(errno));
return STREAM_ERROR;
}
return STREAM_OK;
@@ -468,7 +468,7 @@ static int set_frequency_v4l(radio_priv_t* priv,float frequency){
static int get_frequency_v4l(radio_priv_t* priv,float* frequency){
__u32 freq;
if (ioctl(priv->radio_fd, VIDIOCGFREQ, &freq) < 0) {
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_GetFreqFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get frequency failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
*frequency=((float)freq)/priv->frac;
@@ -490,7 +490,7 @@ static void set_volume_v4l(radio_priv_t* priv,int volume){
memset(&audio,0,sizeof(audio));
audio.flags = (volume==0?VIDEO_AUDIO_MUTE:0);
if (ioctl(priv->radio_fd, VIDIOCSAUDIO, &audio)<0){
- mp_msg(MSGT_RADIO,MSGL_WARN,MSGTR_RADIO_SetMuteFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] ioctl set mute failed: %s\n",strerror(errno));
}
memset(&audio,0,sizeof(audio));
@@ -500,7 +500,7 @@ static void set_volume_v4l(radio_priv_t* priv,int volume){
audio.volume = volume* (65535 / 100);
if (ioctl(priv->radio_fd, VIDIOCSAUDIO, &audio) < 0){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_SetVolumeFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl set volume failed: %s\n",strerror(errno));
}
}
@@ -515,7 +515,7 @@ static int get_volume_v4l(radio_priv_t* priv,int* volume){
memset(&audio,0,sizeof(audio));
audio.audio=0;
if (ioctl(priv->radio_fd, VIDIOCGAUDIO, &audio) < 0){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_GetVolumeFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get volume failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
@@ -533,7 +533,7 @@ static int get_volume_v4l(radio_priv_t* priv,int* volume){
/* v4l driver info structure */
static const radio_driver_t radio_driver_v4l={
"v4l",
- MSGTR_RADIO_DriverV4L,
+ _("[radio] Using V4Lv1 radio interface.\n"),
init_frac_v4l,
set_volume_v4l,
get_volume_v4l,
@@ -576,7 +576,7 @@ static int set_frequency_bsdbt848(radio_priv_t* priv,float frequency){
unsigned int freq;
freq=frequency*priv->frac;
if(ioctl(priv->radio_fd,RADIO_SETFREQ,&freq)<0){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_SetFreqFailed,freq, frequency, strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n",freq, frequency, strerror(errno));
return STREAM_ERROR;
}
return STREAM_OK;
@@ -590,7 +590,7 @@ static int set_frequency_bsdbt848(radio_priv_t* priv,float frequency){
static int get_frequency_bsdbt848(radio_priv_t* priv,float* frequency){
unsigned int freq;
if (ioctl(priv->radio_fd, RADIO_GETFREQ, &freq) < 0) {
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_GetFreqFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get frequency failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
*frequency=((float)freq)/priv->frac;
@@ -614,7 +614,7 @@ static void set_volume_bsdbt848(radio_priv_t* priv,int volume){
audio_flags = (volume==0?AUDIO_MUTE:AUDIO_UNMUTE);
if (ioctl(priv->radio_fd, BT848_SAUDIO, &audio_flags)<0){
- mp_msg(MSGT_RADIO,MSGL_WARN,MSGTR_RADIO_SetMuteFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_WARN,"[radio] ioctl set mute failed: %s\n",strerror(errno));
}
}
@@ -630,7 +630,7 @@ static int get_volume_bsdbt848(radio_priv_t* priv,int* volume){
int audio_flags;
if (ioctl(priv->radio_fd, BT848_GAUDIO, &audio_flags)<0){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_GetVolumeFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] ioctl get volume failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
@@ -645,7 +645,7 @@ static int get_volume_bsdbt848(radio_priv_t* priv,int* volume){
/* bsdbt848 driver info structure */
static const radio_driver_t radio_driver_bsdbt848={
"bsdbt848",
- MSGTR_RADIO_DriverBSDBT848,
+ _("[radio] Using *BSD BT848 radio interface.\n"),
init_frac_bsdbt848,
set_volume_bsdbt848,
get_volume_bsdbt848,
@@ -659,7 +659,7 @@ static inline int init_frac(radio_priv_t* priv){
}
static inline int set_frequency(radio_priv_t* priv,float frequency){
if ((frequency<priv->rangelow)||(frequency>priv->rangehigh)){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongFreq,frequency);
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Wrong frequency: %.2f\n",frequency);
return STREAM_ERROR;
}
if(priv->driver->set_frequency(priv,frequency)!=STREAM_OK)
@@ -667,7 +667,7 @@ static inline int set_frequency(radio_priv_t* priv,float frequency){
#ifdef CONFIG_RADIO_CAPTURE
if(clear_buffer(priv)!=STREAM_OK){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_ClearBufferFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Clearing buffer failed: %s\n",strerror(errno));
return STREAM_ERROR;
}
#endif
@@ -722,16 +722,16 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer)
if (ret != ai->alsa.chunk_size) {
if (ret < 0) {
if (ret==-EAGAIN) return -1;
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio, snd_strerror(ret));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "\nError reading audio: %s\n", snd_strerror(ret));
if (ret == -EPIPE) {
if (ai_alsa_xrun(ai) == 0) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_XRUNSomeFramesMayBeLeftOut);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "Recovered from cross-run, some frames may be left out!\n");
} else {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrFatalCannotRecover);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "Fatal error, cannot recover!\n");
}
}
} else {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_NotEnoughSamples);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "\nNot enough audio samples!\n");
}
return -1;
}
@@ -753,7 +753,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer)
if (ret<0){
if (errno==EAGAIN && bt==0) return -1; //no data avail yet
if (errno==EAGAIN) { usleep(1000); continue;} //nilling buffer to blocksize size
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio, strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "\nError reading audio: %s\n", strerror(errno));
return -1;
}
bt+=ret;
@@ -785,7 +785,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer)
static int grab_audio_frame(radio_priv_t *priv, char *buffer, int len)
{
int i;
- mp_msg(MSGT_RADIO, MSGL_DBG3, MSGTR_RADIO_BufferString,"grab_audio_frame",priv->audio_cnt,priv->audio_drop);
+ mp_tmsg(MSGT_RADIO, MSGL_DBG3, "[radio] %s: in buffer=%d dropped=%d\n","grab_audio_frame",priv->audio_cnt,priv->audio_drop);
/* Cache buffer must be filled by some audio packets when playing starts.
Otherwise MPlayer will quit with EOF error.
Probably, there is need more carefull checking rather than simple 'for' loop
@@ -835,7 +835,7 @@ static int init_audio(radio_priv_t *priv)
}
priv->do_capture=1;
- mp_msg(MSGT_RADIO,MSGL_V,MSGTR_RADIO_CaptureStarting);
+ mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Starting capture stuff.\n");
#ifdef CONFIG_ALSA
while ((tmp = strrchr(priv->radio_param->adevice, '='))){
tmp[0] = ':';
@@ -847,7 +847,7 @@ static int init_audio(radio_priv_t *priv)
#endif
if(audio_in_init(&priv->audio_in, is_oss?AUDIO_IN_OSS:AUDIO_IN_ALSA)<0){
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_AudioInInitFailed);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] audio_in_init failed.\n");
}
audio_in_set_device(&priv->audio_in, priv->radio_param->adevice);
@@ -855,7 +855,7 @@ static int init_audio(radio_priv_t *priv)
audio_in_set_samplerate(&priv->audio_in, priv->radio_param->arate);
if (audio_in_setup(&priv->audio_in) < 0) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_AudioInSetupFailed, strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] audio_in_setup call failed: %s\n", strerror(errno));
return STREAM_ERROR;
}
#ifdef CONFIG_OSS_AUDIO
@@ -871,12 +871,12 @@ static int init_audio(radio_priv_t *priv)
priv->audio_in.bytes_per_sample+priv->audio_in.blocksize;
if (priv->audio_buffer_size < 256*priv->audio_in.blocksize)
priv->audio_buffer_size = 256*priv->audio_in.blocksize;
- mp_msg(MSGT_RADIO, MSGL_V, MSGTR_RADIO_AudioBuffer,
+ mp_tmsg(MSGT_RADIO, MSGL_V, "[radio] Audio capture - buffer=%d bytes (block=%d bytes).\n",
priv->audio_buffer_size,priv->audio_in.blocksize);
/* start capture */
priv->audio_ringbuffer = calloc(1, priv->audio_buffer_size);
if (!priv->audio_ringbuffer) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_AllocateBufferFailed,priv->audio_in.blocksize, priv->audio_buffer_size, strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] cannot allocate audio buffer (block=%d,buf=%d): %s\n",priv->audio_in.blocksize, priv->audio_buffer_size, strerror(errno));
return STREAM_ERROR;
}
priv->audio_head = 0;
@@ -900,7 +900,7 @@ static int init_audio(radio_priv_t *priv)
* \parameter frequency pointer to float, which will contain frequency in MHz
* \return 1 if success,0 - otherwise
*/
-int radio_get_freq(struct stream_st *stream, float* frequency){
+int radio_get_freq(struct stream *stream, float *frequency){
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (!frequency)
@@ -915,7 +915,7 @@ int radio_get_freq(struct stream_st *stream, float* frequency){
* \parameter frequency frequency in MHz
* \return 1 if success,0 - otherwise
*/
-int radio_set_freq(struct stream_st *stream, float frequency){
+int radio_set_freq(struct stream *stream, float frequency){
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (set_frequency(priv,frequency)!=STREAM_OK){
@@ -924,7 +924,7 @@ int radio_set_freq(struct stream_st *stream, float frequency){
if (get_frequency(priv,&frequency)!=STREAM_OK){
return 0;
}
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_CurrentFreq,frequency);
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Current frequency: %.2f\n",frequency);
return 1;
}
@@ -934,7 +934,7 @@ int radio_set_freq(struct stream_st *stream, float frequency){
* \return 1 if success,0 - otherwise
*
*/
-int radio_step_freq(struct stream_st *stream, float step_interval){
+int radio_step_freq(struct stream *stream, float step_interval){
float frequency;
radio_priv_t* priv=(radio_priv_t*)stream->priv;
@@ -957,7 +957,7 @@ int radio_step_freq(struct stream_st *stream, float step_interval){
* if channel parameter is NULL function prints error message and does nothing, otherwise
* changes channel to prev or next in list
*/
-int radio_step_channel(struct stream_st *stream, int direction) {
+int radio_step_channel(struct stream *stream, int direction) {
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (priv->radio_channel_list) {
@@ -969,7 +969,7 @@ int radio_step_channel(struct stream_st *stream, int direction) {
priv->radio_channel_current = priv->radio_channel_list;
if(!radio_set_freq(stream,priv->radio_channel_current->freq))
return 0;
- mp_msg(MSGT_RADIO, MSGL_V, MSGTR_RADIO_SelectedChannel,
+ mp_tmsg(MSGT_RADIO, MSGL_V, "[radio] Selected channel: %d - %s (freq: %.2f)\n",
priv->radio_channel_current->index, priv->radio_channel_current->name,
priv->radio_channel_current->freq);
break;
@@ -981,13 +981,13 @@ int radio_step_channel(struct stream_st *stream, int direction) {
priv->radio_channel_current = priv->radio_channel_current->next;
if(!radio_set_freq(stream,priv->radio_channel_current->freq))
return 0;
- mp_msg(MSGT_RADIO, MSGL_V, MSGTR_RADIO_SelectedChannel,
+ mp_tmsg(MSGT_RADIO, MSGL_V, "[radio] Selected channel: %d - %s (freq: %.2f)\n",
priv->radio_channel_current->index, priv->radio_channel_current->name,
priv->radio_channel_current->freq);
break;
}
}else
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_ChangeChannelNoChannelList);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Can not change channel: no channel list given.\n");
return 1;
}
@@ -999,14 +999,14 @@ int radio_step_channel(struct stream_st *stream, int direction) {
* if channel parameter is NULL function prints error message and does nothing, otherwise
* changes channel to given
*/
-int radio_set_channel(struct stream_st *stream, char *channel) {
+int radio_set_channel(struct stream *stream, char *channel) {
radio_priv_t* priv=(radio_priv_t*)stream->priv;
int i, channel_int;
radio_channels_t* tmp;
char* endptr;
if (*channel=='\0')
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongChannelName,channel);
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Wrong channel name: %s\n",channel);
if (priv->radio_channel_list) {
channel_int = strtol(channel,&endptr,10);
@@ -1017,7 +1017,7 @@ int radio_set_channel(struct stream_st *stream, char *channel) {
if (!strncmp(channel,tmp->name,sizeof(tmp->name)-1))
break;
if (!tmp){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongChannelName,channel);
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Wrong channel name: %s\n",channel);
return 0;
}
}else{
@@ -1027,17 +1027,17 @@ int radio_set_channel(struct stream_st *stream, char *channel) {
else
break;
if (tmp->index!=channel_int){
- mp_msg(MSGT_RADIO,MSGL_ERR,MSGTR_RADIO_WrongChannelNumberInt,channel_int);
+ mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Wrong channel number: %d\n",channel_int);
return 0;
}
}
priv->radio_channel_current=tmp;
- mp_msg(MSGT_RADIO, MSGL_V, MSGTR_RADIO_SelectedChannel, priv->radio_channel_current->index,
+ mp_tmsg(MSGT_RADIO, MSGL_V, "[radio] Selected channel: %d - %s (freq: %.2f)\n", priv->radio_channel_current->index,
priv->radio_channel_current->name, priv->radio_channel_current->freq);
if(!radio_set_freq(stream, priv->radio_channel_current->freq))
return 0;
} else
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_ChangeChannelNoChannelList);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Can not change channel: no channel list given.\n");
return 1;
}
@@ -1047,7 +1047,7 @@ int radio_set_channel(struct stream_st *stream, char *channel) {
*
* NOTE: return value may be NULL (e.g. when channel list not initialized)
*/
-char* radio_get_channel_name(struct stream_st *stream){
+char* radio_get_channel_name(struct stream *stream){
radio_priv_t* priv=(radio_priv_t*)stream->priv;
if (priv->radio_channel_current) {
return priv->radio_channel_current->name;
@@ -1059,7 +1059,7 @@ char* radio_get_channel_name(struct stream_st *stream){
* \brief fills given buffer with audio data
* \return number of bytes, written into buffer
*/
-static int fill_buffer_s(struct stream_st *s, char* buffer, int max_len){
+static int fill_buffer_s(struct stream *s, char *buffer, int max_len){
int len=max_len;
#ifdef CONFIG_RADIO_CAPTURE
@@ -1129,7 +1129,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
else
priv->driver=NULL;
- mp_msg(MSGT_RADIO,MSGL_V,MSGTR_RADIO_AvailableDrivers);
+ mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Available drivers: ");
for(i=0;radio_drivers[i];i++){
mp_msg(MSGT_RADIO,MSGL_V,"%s, ",radio_drivers[i]->name);
if(strcmp(priv->radio_param->driver,radio_drivers[i]->name)==0)
@@ -1140,7 +1140,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
if(priv->driver)
mp_msg(MSGT_RADIO, MSGL_INFO, priv->driver->info);
else{
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_DriverUnknownStr,priv->radio_param->driver);
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Unknown driver name: %s\n",priv->radio_param->driver);
close_s(stream);
return STREAM_ERROR;
}
@@ -1160,12 +1160,12 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
priv->radio_fd = open(priv->radio_param->device, O_RDONLY);
if (priv->radio_fd < 0) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_UnableOpenDevice,
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Unable to open '%s': %s\n",
priv->radio_param->device, strerror(errno));
close_s(stream);
return STREAM_ERROR;
}
- mp_msg(MSGT_RADIO, MSGL_V, MSGTR_RADIO_RadioDevice, priv->radio_fd,priv->radio_param->device);
+ mp_tmsg(MSGT_RADIO, MSGL_V, "[radio] Radio fd: %d, %s\n", priv->radio_fd,priv->radio_param->device);
fcntl(priv->radio_fd, F_SETFD, FD_CLOEXEC);
get_volume(priv, &priv->old_snd_volume);
@@ -1182,11 +1182,11 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
if ((frequency<priv->rangelow)||(frequency>priv->rangehigh)){
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_WrongFreq,frequency);
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Wrong frequency: %.2f\n",frequency);
close_s(stream);
return STREAM_ERROR;
}else
- mp_msg(MSGT_RADIO, MSGL_INFO, MSGTR_RADIO_UsingFreq,frequency);
+ mp_tmsg(MSGT_RADIO, MSGL_INFO, "[radio] Using frequency: %.2f.\n",frequency);
if(set_frequency(priv,frequency)!=STREAM_OK){
close_s(stream);
@@ -1205,7 +1205,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
if(!stream_enable_cache(stream,5*priv->audio_in.samplerate*priv->audio_in.channels*
priv->audio_in.bytes_per_sample,2*priv->audio_in.samplerate*priv->audio_in.channels*
priv->audio_in.bytes_per_sample,priv->audio_in.blocksize)) {
- mp_msg(MSGT_RADIO, MSGL_ERR, MSGTR_RADIO_StreamEnableCacheFailed,strerror(errno));
+ mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] Call to stream_enable_cache failed: %s\n",strerror(errno));
close_s(stream);
return STREAM_ERROR;
}
@@ -1220,7 +1220,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
/*****************************************************************
* Close stream. Clear structures.
*/
-static void close_s(struct stream_st * stream){
+static void close_s(struct stream *stream){
radio_priv_t* priv=(radio_priv_t*)stream->priv;
radio_channels_t * tmp;
if (!priv) return;
@@ -1263,4 +1263,3 @@ const stream_info_t stream_info_radio = {
&stream_opts,
1 // Urls are an option string
};
-
diff --git a/stream/stream_radio.h b/stream/stream_radio.h
index c2de25a5aa..ff8ea74cef 100644
--- a/stream/stream_radio.h
+++ b/stream/stream_radio.h
@@ -37,11 +37,11 @@ typedef struct radio_param_s{
extern radio_param_t stream_radio_defaults;
-int radio_set_freq(struct stream_st *stream, float freq);
-int radio_get_freq(struct stream_st *stream, float* freq);
-char* radio_get_channel_name(struct stream_st *stream);
-int radio_set_channel(struct stream_st *stream, char *channel);
-int radio_step_channel(struct stream_st *stream, int direction);
-int radio_step_freq(struct stream_st *stream, float step_interval);
+int radio_set_freq(struct stream *stream, float freq);
+int radio_get_freq(struct stream *stream, float* freq);
+char* radio_get_channel_name(struct stream *stream);
+int radio_set_channel(struct stream *stream, char *channel);
+int radio_step_channel(struct stream *stream, int direction);
+int radio_step_freq(struct stream *stream, float step_interval);
#endif /* MPLAYER_STREAM_RADIO_H */
diff --git a/stream/stream_rtsp.c b/stream/stream_rtsp.c
index 336db6144c..e02255e531 100644
--- a/stream/stream_rtsp.c
+++ b/stream/stream_rtsp.c
@@ -130,7 +130,7 @@ rtsp_streaming_start (stream_t *stream)
}
static void
-rtsp_streaming_close (struct stream_st *s)
+rtsp_streaming_close (struct stream *s)
{
rtsp_session_t *rtsp = NULL;
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index 86bb3f84b0..027640f921 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -119,14 +119,14 @@ static int open_f (stream_t *stream, int mode, void *opts, int* file_format) {
err = smbc_init(smb_auth_fn, 1);
if (err < 0) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_SMBInitError,err);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Cannot init the libsmbclient library: %d\n",err);
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
fd = smbc_open(filename, m,0644);
if (fd < 0) {
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_SMBFileNotFound, filename);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"Could not open from LAN: '%s'\n", filename);
m_struct_free(&stream_opts, opts);
return STREAM_ERROR;
}
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 53e82f7da2..a7f77e193b 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -112,7 +112,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
f=open(p->device,O_RDONLY);
#endif
if(f<0){
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device);
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"CD-ROM Device '%s' not found.\n",p->device);
m_struct_free(&stream_opts,opts);
return STREAM_ERROR;
}
@@ -126,7 +126,8 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
ret2=vcd_get_track_end(vcd,p->track);
if(ret2<0){
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (get)\n");
+ mp_msg(MSGT_OPEN, MSGL_ERR, "%s (get)\n",
+ mp_gtext("Error selecting VCD track."));
close(f);
free(vcd);
m_struct_free(&stream_opts,opts);
@@ -134,7 +135,8 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
ret=vcd_seek_to_track(vcd,p->track);
if(ret<0){
- mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");
+ mp_msg(MSGT_OPEN, MSGL_ERR, "%s (seek)\n",
+ mp_gtext("Error selecting VCD track."));
close(f);
free(vcd);
m_struct_free(&stream_opts,opts);
diff --git a/stream/stream_vstream.c b/stream/stream_vstream.c
index ff173855f5..7575b76bb1 100644
--- a/stream/stream_vstream.c
+++ b/stream/stream_vstream.c
@@ -95,11 +95,11 @@ static int seek(stream_t *s,off_t newpos) {
return 1;
}
-static int control(struct stream_st *s,int cmd,void* arg) {
+static int control(struct stream *s,int cmd,void *arg) {
return STREAM_UNSUPPORTED;
}
-static void close_s(struct stream_st *s) {
+static void close_s(struct stream *s) {
}
static int open_s(stream_t *stream, int mode, void* opts, int* file_format) {
diff --git a/stream/tcp.c b/stream/tcp.c
index ff4db78847..0291fba544 100644
--- a/stream/tcp.c
+++ b/stream/tcp.c
@@ -109,7 +109,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
case AF_INET6: our_s_addr = (void *) &server_address.six.sin6_addr; break;
#endif
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR, MSGTR_MPDEMUX_NW_UnknownAF, af);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR, "Unknown address family %d\n", af);
return TCP_ERROR_FATAL;
}
@@ -124,7 +124,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
if ( inet_addr(host)==INADDR_NONE )
#endif
{
- if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ResolvingHostForAF, host, af2String(af));
+ if(verb) mp_tmsg(MSGT_NETWORK,MSGL_STATUS,"Resolving %s for %s...\n", host, af2String(af));
#ifdef HAVE_GETHOSTBYNAME2
hp=(struct hostent*)gethostbyname2( host, af );
@@ -132,7 +132,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
hp=(struct hostent*)gethostbyname( host );
#endif
if( hp==NULL ) {
- if(verb) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_CantResolv, af2String(af), host);
+ if(verb) mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Couldn't resolve name for %s: %s\n", af2String(af), host);
return TCP_ERROR_FATAL;
}
@@ -159,7 +159,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
break;
#endif
default:
- mp_msg(MSGT_NETWORK,MSGL_ERR, MSGTR_MPDEMUX_NW_UnknownAF, af);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR, "Unknown address family %d\n", af);
return TCP_ERROR_FATAL;
}
@@ -168,7 +168,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
#else
inet_ntop(af, our_s_addr, buf, 255);
#endif
- if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port );
+ if(verb) mp_tmsg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]: %d...\n", host, buf , port );
// Turn the socket as non blocking so we can timeout on the connection
#if !HAVE_WINSOCK2_H
@@ -183,7 +183,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
#else
if( (WSAGetLastError() != WSAEINPROGRESS) && (WSAGetLastError() != WSAEWOULDBLOCK) ) {
#endif
- if(verb) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_CantConnect2Server, af2String(af));
+ if(verb) mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Failed to connect to server with %s\n", af2String(af));
closesocket(socket_server_fd);
return TCP_ERROR_PORT;
}
@@ -196,7 +196,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) {
if(count > 30 || stream_check_interrupt(500)) {
if(count > 30)
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnTimeout);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"connection timeout\n");
else
mp_msg(MSGT_NETWORK,MSGL_V,"Connection interrupted by user\n");
return TCP_ERROR_TIMEOUT;
@@ -207,7 +207,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
tv.tv_sec = 0;
tv.tv_usec = 500000;
}
- if (ret < 0) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_SelectFailed);
+ if (ret < 0) mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Select failed.\n");
// Turn back the socket as blocking
#if !HAVE_WINSOCK2_H
@@ -220,11 +220,11 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
err_len = sizeof(int);
ret = getsockopt(socket_server_fd,SOL_SOCKET,SO_ERROR,&err,&err_len);
if(ret < 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_GetSockOptFailed,strerror(errno));
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"getsockopt failed: %s\n",strerror(errno));
return TCP_ERROR_FATAL;
}
if(err > 0) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnectError,strerror(err));
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"connect error: %s\n",strerror(err));
return TCP_ERROR_PORT;
}
diff --git a/stream/tv.c b/stream/tv.c
index 63497472c9..69f3d80693 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -84,7 +84,7 @@ static void tv_scan(tvi_handle_t *tvh)
//Channel scanner without tuner is useless and causes crash due to uninitialized chanlist_s
if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) != TVI_CONTROL_TRUE)
{
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_ScannerNotAvailableWithoutTuner);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "Channel scanner is not available without tuner\n");
tvh->tv_param->scan=0;
return;
}
@@ -221,7 +221,7 @@ static int norm_from_string(tvi_handle_t *tvh, char* norm)
if(ret!=TVI_CONTROL_UNKNOWN)
{
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_BogusNormParameter, norm,"default");
+ mp_tmsg(MSGT_TV, MSGL_WARN, "tv.c: norm_from_string(%s): Bogus norm parameter, setting %s.\n", norm,"default");
return 0;
}
@@ -240,7 +240,7 @@ static int norm_from_string(tvi_handle_t *tvh, char* norm)
else if (!strcasecmp(norm, "ntscjp"))
return TV_NORM_NTSCJP;
else {
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_BogusNormParameter, norm, "PAL");
+ mp_tmsg(MSGT_TV, MSGL_WARN, "tv.c: norm_from_string(%s): Bogus norm parameter, setting %s.\n", norm, "PAL");
return TV_NORM_PAL;
}
}
@@ -249,7 +249,7 @@ static void parse_channels(tvi_handle_t *tvh)
{
char** channels = tvh->tv_param->channels;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_ChannelNamesDetected);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "TV channel names detected.\n");
tv_channel_list = malloc(sizeof(tv_channels_t));
tv_channel_list->index=1;
tv_channel_list->next=NULL;
@@ -289,7 +289,7 @@ static void parse_channels(tvi_handle_t *tvh)
}
}
if (tv_channel_current->freq == 0)
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoFreqForChannel,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Couldn't find frequency for channel %s (%s)\n",
tv_channel_current->number, tv_channel_current->name);
else {
sep = strchr(tv_channel_current->name, '-');
@@ -329,9 +329,9 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
{
tvh->norm = norm_from_string(tvh, norm);
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, norm);
+ mp_tmsg(MSGT_TV, MSGL_V, "Selected norm : %s\n", norm);
if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n");
return 0;
}
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
@@ -339,13 +339,13 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
return 1;
}
-int tv_set_norm_i(tvi_handle_t *tvh, int norm)
+static int tv_set_norm_i(tvi_handle_t *tvh, int norm)
{
tvh->norm = norm;
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNormId, norm);
+ mp_tmsg(MSGT_TV, MSGL_V, "Selected norm id: %d\n", norm);
if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n");
return 0;
}
@@ -371,7 +371,7 @@ static int open_tv(tvi_handle_t *tvh)
if (funcs->control(tvh->priv, TVI_CONTROL_IS_VIDEO, 0) != TVI_CONTROL_TRUE)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoVideoInputPresent);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error: No video input present!\n");
return 0;
}
@@ -399,7 +399,14 @@ static int open_tv(tvi_handle_t *tvh)
case IMGFMT_BGR15:
break;
default:
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnknownImageFormat,tvh->tv_param->outfmt);
+ mp_tmsg(MSGT_TV, MSGL_ERR,
+ "==================================================================\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);
}
@@ -436,8 +443,8 @@ static int open_tv(tvi_handle_t *tvh)
else
tvh->tv_param->height = 480/tvh->tv_param->decimation;
}
- mp_msg(MSGT_TV, MSGL_INFO,
- MSGTR_TV_MJP_WidthHeight, tvh->tv_param->width, tvh->tv_param->height);
+ mp_tmsg(MSGT_TV, MSGL_INFO,
+ " MJP: width %d height %d\n", tvh->tv_param->width, tvh->tv_param->height);
}
#endif
@@ -455,7 +462,7 @@ static int open_tv(tvi_handle_t *tvh)
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tvh->tv_param->width);
else
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetWidth, tvh->tv_param->width);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Unable to set requested width: %d\n", tvh->tv_param->width);
funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &tvh->tv_param->width);
}
}
@@ -467,14 +474,14 @@ static int open_tv(tvi_handle_t *tvh)
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tvh->tv_param->height);
else
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetHeight, tvh->tv_param->height);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "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_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_NoTuner);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "Selected input hasn't got a tuner!\n");
goto done;
}
@@ -490,15 +497,15 @@ static int open_tv(tvi_handle_t *tvh)
}
if (tvh->chanlist == -1)
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnableFindChanlist,
+ mp_tmsg(MSGT_TV, MSGL_WARN, "Unable to find selected channel list! (%s)\n",
tvh->tv_param->chanlist);
else
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedChanlist,
+ mp_tmsg(MSGT_TV, MSGL_V, "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_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_ChannelFreqParamConflict);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "You can't set frequency and channel simultaneously!\n");
goto done;
}
@@ -540,7 +547,7 @@ static int open_tv(tvi_handle_t *tvh)
tv_channel_current = tv_channel_current->next;
}
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n", tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
@@ -555,14 +562,14 @@ static int open_tv(tvi_handle_t *tvh)
funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
funcs->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedFrequency,
+ mp_tmsg(MSGT_TV, MSGL_V, "Selected frequency: %lu (%.3f)\n",
freq, (float)freq/16);
}
if (tvh->tv_param->channel) {
struct CHANLIST cl;
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_RequestedChannel, tvh->tv_param->channel);
+ mp_tmsg(MSGT_TV, MSGL_V, "Requested channel: %s\n", tvh->tv_param->channel);
for (i = 0; i < chanlists[tvh->chanlist].count; i++)
{
cl = tvh->chanlist_s[i];
@@ -572,7 +579,7 @@ static int open_tv(tvi_handle_t *tvh)
{
strcpy(tv_channel_last_real, cl.name);
tvh->channel = i;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
break;
@@ -610,7 +617,7 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param)
int i;
tvi_handle_t* h;
if(tv_param->driver && !strcmp(tv_param->driver,"help")){
- mp_msg(MSGT_TV,MSGL_INFO,MSGTR_TV_AvailableDrivers);
+ mp_tmsg(MSGT_TV,MSGL_INFO,"Available drivers:\n");
for(i=0;tvi_driver_list[i];i++){
mp_msg(MSGT_TV,MSGL_INFO," %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name);
if(tvi_driver_list[i]->comment)
@@ -631,7 +638,7 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param)
continue;
h->tv_param=tv_param;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_DriverInfo, tvi_driver_list[i]->short_name,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected driver: %s\n name: %s\n author: %s\n comment: %s\n", tvi_driver_list[i]->short_name,
tvi_driver_list[i]->name,
tvi_driver_list[i]->author,
tvi_driver_list[i]->comment?tvi_driver_list[i]->comment:"");
@@ -641,9 +648,9 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param)
}
if(tv_param->driver)
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoSuchDriver, tv_param->driver);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "No such driver: %s\n", tv_param->driver);
else
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_DriverAutoDetectionFailed);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "TV driver autodetection failed.\n");
return NULL;
}
@@ -761,7 +768,7 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
case AF_FORMAT_A_LAW:
case AF_FORMAT_MPEG2:
default:
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnsupportedAudioType,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Audio type '%s (%x)' unsupported!\n",
af_fmt2str(audio_format, buf, 128), audio_format);
goto no_audio;
}
@@ -791,7 +798,7 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
sh_audio->wf->nBlockAlign = sh_audio->samplesize * sh_audio->channels;
sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps;
- mp_msg(MSGT_DECVIDEO, MSGL_V, MSGTR_TV_AudioFormat,
+ mp_tmsg(MSGT_DECVIDEO, MSGL_V, " TV audio: %d channels, %d bits, %d Hz\n",
sh_audio->wf->nChannels, sh_audio->wf->wBitsPerSample,
sh_audio->wf->nSamplesPerSec);
@@ -849,7 +856,7 @@ int tv_set_color_options(tvi_handle_t *tvh, int opt, int value)
case TV_COLOR_CONTRAST:
return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_CONTRAST, &value);
default:
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnknownColorOption, opt);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "Unknown color option (%d) specified!\n", opt);
}
return TVI_CONTROL_UNKNOWN;
@@ -870,7 +877,7 @@ int tv_get_color_options(tvi_handle_t *tvh, int opt, int* value)
case TV_COLOR_CONTRAST:
return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_CONTRAST, value);
default:
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnknownColorOption, opt);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "Unknown color option (%d) specified!\n", opt);
}
return TVI_CONTROL_UNKNOWN;
@@ -881,7 +888,7 @@ 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_msg(MSGT_TV, MSGL_V, MSGTR_TV_CurrentFrequency,
+ mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n",
*freq, (float)*freq/16);
}
return 1;
@@ -897,7 +904,7 @@ int tv_set_freq(tvi_handle_t *tvh, unsigned long freq)
tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq);
tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq);
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_CurrentFrequency,
+ mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n",
freq, (float)freq/16);
}
teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
@@ -942,7 +949,7 @@ int tv_step_channel_real(tvi_handle_t *tvh, int direction)
{
strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
cl = tvh->chanlist_s[--tvh->channel];
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
}
@@ -954,7 +961,7 @@ int tv_step_channel_real(tvi_handle_t *tvh, int direction)
{
strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
cl = tvh->chanlist_s[++tvh->channel];
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
}
@@ -974,7 +981,7 @@ int tv_step_channel(tvi_handle_t *tvh, int direction) {
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n",
tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
}
if (direction == TV_CHANNEL_LOWER) {
@@ -986,7 +993,7 @@ int tv_step_channel(tvi_handle_t *tvh, int direction) {
tv_channel_current = tv_channel_current->next;
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n",
tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
}
} else tv_step_channel_real(tvh, direction);
@@ -1007,7 +1014,7 @@ int tv_set_channel_real(tvi_handle_t *tvh, char *channel) {
if (!strcasecmp(cl.name, channel))
{
tvh->channel = i;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
break;
@@ -1027,7 +1034,7 @@ int tv_set_channel(tvi_handle_t *tvh, char *channel) {
for (i = 1; i < channel_int; i++)
if (tv_channel_current->next)
tv_channel_current = tv_channel_current->next;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n", tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
@@ -1045,7 +1052,7 @@ int tv_last_channel(tvi_handle_t *tvh) {
tv_channel_last = tv_channel_current;
tv_channel_current = tmp;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s - %s (freq: %.3f)\n", tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
@@ -1060,7 +1067,7 @@ int tv_last_channel(tvi_handle_t *tvh) {
{
strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name);
tvh->channel = i;
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2,
+ mp_tmsg(MSGT_TV, MSGL_INFO, "Selected channel: %s (freq: %.3f)\n",
cl.name, (float)cl.freq/1000);
tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16));
break;
@@ -1078,7 +1085,7 @@ int tv_step_norm(tvi_handle_t *tvh)
tvh->norm = 0;
if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM,
&tvh->norm) != TVI_CONTROL_TRUE) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n");
return 0;
}
}
diff --git a/stream/tvi_bsdbt848.c b/stream/tvi_bsdbt848.c
index 431e8f9100..f21f9d4eee 100644
--- a/stream/tvi_bsdbt848.c
+++ b/stream/tvi_bsdbt848.c
@@ -233,7 +233,7 @@ static int control(priv_t *priv, int cmd, void *arg)
{
if(ioctl(priv->tunerfd, TVTUNER_GETFREQ, &priv->tunerfreq) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "TVTUNER_GETFREQ", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "TVTUNER_GETFREQ", strerror(errno));
return TVI_CONTROL_FALSE;
}
@@ -247,7 +247,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->tunerfd, TVTUNER_SETFREQ, &priv->tunerfreq) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "TVTUNER_SETFREQ", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "TVTUNER_SETFREQ", strerror(errno));
return 0;
}
@@ -258,7 +258,7 @@ static int control(priv_t *priv, int cmd, void *arg)
int status;
if(ioctl(priv->tunerfd, TVTUNER_GETSTATUS, &status) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "GETSTATUS", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "GETSTATUS", strerror(errno));
return 0;
}
*(int*)arg=(status & 0x02)? 100 : 0;
@@ -274,7 +274,7 @@ static int control(priv_t *priv, int cmd, void *arg)
{
if(ioctl(priv->btfd, METEORGINPUT, &priv->input) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORGINPUT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORGINPUT", strerror(errno));
return TVI_CONTROL_FALSE;
}
@@ -288,7 +288,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSINPUT, &priv->input) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSINPUT", strerror(errno));
return 0;
}
@@ -317,7 +317,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848InvalidAudioRate, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Invalid audio rate. Error: %s\n", strerror(errno));
return TVI_CONTROL_FALSE;
}
@@ -405,20 +405,20 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFMT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSFMT", strerror(errno));
return TVI_CONTROL_FALSE;
}
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSETGEO", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSETGEO", strerror(errno));
return 0;
}
tmp_fps = priv->fps;
if(ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSFPS", strerror(errno));
return 0;
}
@@ -426,7 +426,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(priv->tunerready == TRUE &&
ioctl(priv->tunerfd, BT848_SAUDIO, &priv->tv_param->audio_id) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "BT848_SAUDIO", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "BT848_SAUDIO", strerror(errno));
}
#endif
@@ -455,7 +455,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Error setting picture width. Error: %s\n", strerror(errno));
return 0;
}
@@ -480,7 +480,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Error setting picture width. Error: %s\n", strerror(errno));
return 0;
}
@@ -502,7 +502,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSFPS", strerror(errno));
return 0;
}
@@ -553,33 +553,33 @@ priv->btfd = open(priv->btdev, O_RDONLY);
if(priv->btfd < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningBktrDev, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Unable to open bktr device. Error: %s\n", strerror(errno));
priv->videoready = FALSE;
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SETEORSFMT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "SETEORSFMT", strerror(errno));
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSINPUT, &priv->source) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSINPUT", strerror(errno));
}
tmp_fps = priv->fps;
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSFPS", strerror(errno));
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSGEQ", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSGEQ", strerror(errno));
}
if(priv->videoready == TRUE)
@@ -591,7 +591,7 @@ if(priv->videoready == TRUE)
if(priv->livebuf == (u_char *) MAP_FAILED)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848MmapFailed, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: mmap failed. Error: %s\n", strerror(errno));
priv->videoready = FALSE;
}
@@ -601,7 +601,7 @@ if(priv->videoready == TRUE)
if(priv->framebuf[count].buf == NULL)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848FrameBufAllocFailed, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Frame buffer allocation failed. Error: %s\n", strerror(errno));
priv->videoready = FALSE;
break;
}
@@ -619,7 +619,7 @@ priv->tunerfd = open(priv->tunerdev, O_RDONLY);
if(priv->tunerfd < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningTunerDev, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Unable to open tuner device. Error: %s\n", strerror(errno));
priv->tunerready = FALSE;
}
@@ -637,7 +637,7 @@ priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps *
if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningDspDev, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Unable to open dsp device. Error: %s\n", strerror(errno));
priv->dspready = FALSE;
}
@@ -645,7 +645,7 @@ marg = (256 << 16) | 12;
if (ioctl(priv->dspfd, SNDCTL_DSP_SETFRAGMENT, &marg ) < 0 )
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SNDCTL_DSP_SETFRAGMENT", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "SNDCTL_DSP_SETFRAGMENT", strerror(errno));
priv->dspready = FALSE;
}
@@ -655,7 +655,7 @@ if((priv->dspready == TRUE) &&
(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &priv->dspspeed) == -1) ||
(ioctl(priv->dspfd, SNDCTL_DSP_SETFMT, &priv->dspfmt) == -1)))
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorConfiguringDsp, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Configuration of dsp failed. Error: %s\n", strerror(errno));
close(priv->dspfd);
priv->dspready = FALSE;
}
@@ -680,7 +680,7 @@ marg = SIGUSR1;
if(ioctl(priv->btfd, METEORSSIGNAL, &marg) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSSIGNAL", strerror(errno));
return 0;
}
@@ -694,7 +694,7 @@ marg = METEOR_CAP_CONTINOUS;
if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORCAPTUR", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORCAPTUR", strerror(errno));
return 0;
}
@@ -711,7 +711,7 @@ marg = METEOR_SIG_MODE_MASK;
if(ioctl( priv->btfd, METEORSSIGNAL, &marg) < 0 )
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "METEORSSIGNAL", strerror(errno));
return 0;
}
@@ -719,7 +719,7 @@ marg = METEOR_CAP_STOP_CONT;
if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 )
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848UnableToStopCapture, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Unable to stop capture. Error: %s\n", strerror(errno));
return 0;
}
@@ -814,7 +814,7 @@ while(bytesread < len)
if(ret == -1)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorReadingAudio, strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Error reading audio data. Error: %s\n", strerror(errno));
return 0;
}
@@ -854,7 +854,7 @@ if(priv->dspready == FALSE) return 0;
#ifdef CONFIG_SUN_AUDIO
if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "AUDIO_GETINFO", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "AUDIO_GETINFO", strerror(errno));
return TVI_CONTROL_FALSE;
}
else
@@ -862,7 +862,7 @@ else
#else
if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0)
{
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "FIONREAD", strerror(errno));
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n", "FIONREAD", strerror(errno));
return TVI_CONTROL_FALSE;
}
#endif
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 9aec47ed54..0563d74f18 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -1089,10 +1089,10 @@ static HRESULT set_nearest_freq(priv_t * priv, long lFreq)
if (load_freq_table(chanlist2country(priv->tv_param->chanlist), tunerInput, &(priv->freq_table), &(priv->freq_table_len), &(priv->first_channel)) != S_OK) {//FIXME
priv->freq_table_len=0;
priv->freq_table=NULL;
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableExtractFreqTable);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to load frequency table from kstvtune.ax\n");
return E_FAIL;
};
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_FreqTableLoaded, tunerInput == TunerInputAntenna ? "broadcast" : "cable",
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: loaded system (%s) frequency table for country id=%d (channels:%d).\n", tunerInput == TunerInputAntenna ? "broadcast" : "cable",
chanlist2country(priv->tv_param->chanlist), priv->freq_table_len);
}
@@ -1109,14 +1109,14 @@ static HRESULT set_nearest_freq(priv_t * priv, long lFreq)
mp_msg(MSGT_TV, MSGL_DBG4, "tvi_dshow: set_nearest_freq #%d (%ld) => %d (%ld)\n",i+priv->first_channel,priv->freq_table[i], nChannel,lFreqDiff);
}
if (nChannel == -1) {
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_UnableFindNearestChannel);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Unable to find nearest channel in system frequency table\n");
return E_FAIL;
}
mp_msg(MSGT_TV, MSGL_V, "tvi_dshow: set_nearest_freq #%d (%ld)\n",nChannel,priv->freq_table[nChannel - priv->first_channel]);
hr = OLE_CALL_ARGS(priv->pTVTuner, put_Channel, nChannel,
AMTUNER_SUBCHAN_DEFAULT, AMTUNER_SUBCHAN_DEFAULT);
if (FAILED(hr)) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableToSetChannel, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"tvi_dshow: Unable to switch to nearest channel from system frequency table. Error:0x%x\n", (unsigned int)hr);
return E_FAIL;
}
return S_OK;
@@ -1143,7 +1143,7 @@ static int set_frequency(priv_t * priv, long lFreq)
if (priv->direct_setfreq_call) { //using direct call to set frequency
hr = set_frequency_direct(priv->pTVTuner, lFreq);
if (FAILED(hr)) {
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_DirectSetFreqFailed);
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: Unable to set frequency directly. OS built-in channels table will be used.\n");
priv->direct_setfreq_call = 0;
}
}
@@ -1218,7 +1218,7 @@ static int get_frequency(priv_t * priv, long *plFreq)
if (priv->direct_getfreq_call) { //using direct call to get frequency
hr = get_frequency_direct(priv->pTVTuner, plFreq);
if (FAILED(hr)) {
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TVI_DS_DirectGetFreqFailed);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "tvi_dshow: Unable to get frequency directly. OS built-in channels table will be used.\n");
priv->direct_getfreq_call = 0;
}
}
@@ -1252,7 +1252,7 @@ static void get_capabilities(priv_t * priv)
mp_msg(MSGT_TV, MSGL_DBG4, "tvi_dshow: get_capabilities called\n");
if (priv->pTVTuner) {
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_SupportedNorms);
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: supported norms:");
hr = OLE_CALL_ARGS(priv->pTVTuner, get_AvailableTVFormats,
&lAvailableFormats);
if (FAILED(hr))
@@ -1276,7 +1276,7 @@ static void get_capabilities(priv_t * priv)
tv_available_inputs = (long *) malloc(sizeof(long) * lInputPins);
tv_available_inputs_count = 0;
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_AvailableVideoInputs);
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: available video inputs:");
for (i = 0; i < lInputPins; i++) {
OLE_CALL_ARGS(priv->pCrossbar, get_CrossbarPinInfo, 1, i,
&lRelated, &lPhysicalType);
@@ -1297,7 +1297,7 @@ static void get_capabilities(priv_t * priv)
hr = OLE_CALL_ARGS(priv->chains[1]->pCaptureFilter, EnumPins, &pEnum);
if (FAILED(hr))
return;
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_AvailableAudioInputs);
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: available audio inputs:");
i = 0;
while (OLE_CALL_ARGS(pEnum, Next, 1, &pPin, NULL) == S_OK) {
memset(&pi, 0, sizeof(pi));
@@ -1319,7 +1319,7 @@ static void get_capabilities(priv_t * priv)
else
OLE_CALL_ARGS(pIAMixer, put_MixLevel, 1.0);
#endif
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_InputSelected);
+ mp_tmsg(MSGT_TV, MSGL_V, "(selected)");
} else {
OLE_CALL_ARGS(pIAMixer, put_Enable, FALSE);
#if 0
@@ -1464,7 +1464,7 @@ static HRESULT build_sub_graph(priv_t * priv, chain_t * chain, const GUID* ppin_
hr = OLE_CALL_ARGS(chain->pCapturePin, ConnectionMediaType, chain->pmt);
if(FAILED(hr))
{
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TVI_DS_GetActualMediatypeFailed, (unsigned int)hr);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "tvi_dshow: Unable to get actual mediatype (Error:0x%x). Assuming equal to requested.\n", (unsigned int)hr);
}
if(priv->tv_param->hidden_video_renderer){
@@ -1578,7 +1578,7 @@ static int set_crossbar_input(priv_t * priv, int input)
//connecting given input with video decoder
hr = OLE_CALL_ARGS(priv->pCrossbar, Route, nVideoDecoder, lInput);
if (hr != S_OK) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableConnectInputVideoDecoder, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"Unable to connect given input to video decoder. Error:0x%x\n", (unsigned int)hr);
return TVI_CONTROL_FALSE;
}
}
@@ -1586,7 +1586,7 @@ static int set_crossbar_input(priv_t * priv, int input)
hr = OLE_CALL_ARGS(priv->pCrossbar, Route, nAudioDecoder,
lInputRelated);
if (hr != S_OK) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableConnectInputAudioDecoder, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"Unable to connect given input to audio decoder. Error:0x%x\n", (unsigned int)hr);
return TVI_CONTROL_FALSE;
}
}
@@ -1990,11 +1990,11 @@ static IBaseFilter *find_capture_device(int index, REFCLSID category)
OLE_CALL(pClassEnum,Reset);
for (i = 0; OLE_CALL_ARGS(pClassEnum, Next, 1, &pM, &cFetched) == S_OK; i++) {
if(get_device_name(pM, tmp, DEVICE_NAME_MAX_LEN)!=TVI_CONTROL_TRUE)
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableGetDeviceName, i);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to get name for device #%d\n", i);
else
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TVI_DS_DeviceName, i, tmp);
+ mp_tmsg(MSGT_TV, MSGL_V, "tvi_dshow: Device #%d: %s\n", i, tmp);
if (index != -1 && i == index) {
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TVI_DS_UsingDevice, index, tmp);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "tvi_dshow: Using device #%d: %s\n", index, tmp);
hr = OLE_CALL_ARGS(pM, BindToObject, 0, 0, &IID_IBaseFilter,(void *) &pFilter);
if (FAILED(hr))
pFilter = NULL;
@@ -2002,7 +2002,7 @@ static IBaseFilter *find_capture_device(int index, REFCLSID category)
OLE_RELEASE_SAFE(pM);
}
if (index != -1 && !pFilter) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_DeviceNotFound,
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Device #%d not found\n",
index);
}
OLE_RELEASE_SAFE(pClassEnum);
@@ -2058,7 +2058,7 @@ static HRESULT get_available_formats_stream(chain_t *chain)
return E_FAIL;
}
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnsupportedMediaType,"get_available_formats_stream");
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unsupported media type passed to %s\n","get_available_formats_stream");
return E_FAIL;
}
done = 0;
@@ -2153,7 +2153,7 @@ static HRESULT get_available_formats_pin(ICaptureGraphBuilder2 * pBuilder,
} else if (chain->type == audio) {
size = sizeof(AUDIO_STREAM_CONFIG_CAPS);
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnsupportedMediaType,"get_available_formats_pin");
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unsupported media type passed to %s\n","get_available_formats_pin");
return E_FAIL;
}
@@ -2513,7 +2513,7 @@ static HRESULT build_video_chain(priv_t *priv)
if (priv->chains[0]->pStreamConfig) {
hr = OLE_CALL_ARGS(priv->chains[0]->pStreamConfig, SetFormat, priv->chains[0]->pmt);
if (FAILED(hr)) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableSelectVideoFormat, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"tvi_dshow: Unable to select video format. Error:0x%x\n", (unsigned int)hr);
}
}
@@ -2530,7 +2530,7 @@ static HRESULT build_video_chain(priv_t *priv)
priv->chains[0]->rbuf->buffersize *= 1024 * 1024;
hr=build_sub_graph(priv, priv->chains[0], &PIN_CATEGORY_CAPTURE);
if(FAILED(hr)){
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableBuildVideoSubGraph,(unsigned int)hr);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to build video chain of capture graph. Error:0x%x\n",(unsigned int)hr);
return hr;
}
return S_OK;
@@ -2556,7 +2556,7 @@ static HRESULT build_audio_chain(priv_t *priv)
hr = OLE_CALL_ARGS(priv->chains[1]->pStreamConfig, SetFormat,
priv->chains[1]->pmt);
if (FAILED(hr)) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableSelectAudioFormat, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"tvi_dshow: Unable to select audio format. Error:0x%x\n", (unsigned int)hr);
}
}
@@ -2573,7 +2573,7 @@ static HRESULT build_audio_chain(priv_t *priv)
hr=build_sub_graph(priv, priv->chains[1],&PIN_CATEGORY_CAPTURE);
if(FAILED(hr)){
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableBuildAudioSubGraph,(unsigned int)hr);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to build audio chain of capture graph. Error:0x%x\n",(unsigned int)hr);
return 0;
}
}
@@ -2603,7 +2603,7 @@ static HRESULT build_vbi_chain(priv_t *priv)
hr=build_sub_graph(priv, priv->chains[2],&PIN_CATEGORY_VBI);
if(FAILED(hr)){
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableBuildVBISubGraph,(unsigned int)hr);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to build VBI chain of capture graph. Error:0x%x\n",(unsigned int)hr);
return 0;
}
}
@@ -2644,12 +2644,12 @@ static int start(priv_t * priv)
mp_msg(MSGT_TV, MSGL_DBG2, "Debug pause end\n");
}
if (!priv->pMediaControl) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableGetMediaControlInterface,(unsigned int)E_POINTER);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"tvi_dshow: Unable to get IMediaControl interface. Error:0x%x\n",(unsigned int)E_POINTER);
return 0;
}
hr = OLE_CALL(priv->pMediaControl, Run);
if (FAILED(hr)) {
- mp_msg(MSGT_TV,MSGL_ERR,MSGTR_TVI_DS_UnableStartGraph, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR,"tvi_dshow: Unable to start graph! Error:0x%x\n", (unsigned int)hr);
return 0;
}
mp_msg(MSGT_TV, MSGL_DBG2, "tvi_dshow: Graph is started.\n");
@@ -2722,7 +2722,7 @@ static int init(priv_t * priv)
mp_msg(MSGT_TV, MSGL_DBG2, "tvi_dshow: Searching for available video capture devices\n");
priv->chains[0]->pCaptureFilter = find_capture_device(priv->dev_index, &CLSID_VideoInputDeviceCategory);
if(!priv->chains[0]->pCaptureFilter){
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_NoVideoCaptureDevice);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Unable to find video capture device\n");
break;
}
hr = OLE_CALL_ARGS(priv->pGraph, AddFilter, priv->chains[0]->pCaptureFilter, NULL);
@@ -2734,7 +2734,7 @@ static int init(priv_t * priv)
if (priv->adev_index != -1) {
priv->chains[1]->pCaptureFilter = find_capture_device(priv->adev_index, &CLSID_AudioInputDeviceCategory); //output available audio edevices
if(!priv->chains[1]->pCaptureFilter){
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_NoAudioCaptureDevice);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Unable to find audio capture device\n");
break;
}
@@ -2754,7 +2754,7 @@ static int init(priv_t * priv)
mp_msg(MSGT_TV, MSGL_DBG2, "tvi_dshow: Get IID_IAMVideoProcAmp failed (0x%x).\n", (unsigned int)hr);
if (hr != S_OK) {
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TVI_DS_VideoAdjustigNotSupported);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "tvi_dshow: Adjusting of brightness/hue/saturation/contrast is not supported by device\n");
priv->pVideoProcAmp = NULL;
}
@@ -2764,7 +2764,7 @@ static int init(priv_t * priv)
priv->chains[0]->pCaptureFilter,
&IID_IAMCrossbar, (void **) &(priv->pCrossbar));
if (FAILED(hr)) {
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TVI_DS_SelectingInputNotSupported);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "tvi_dshow: Selection of capture source is not supported by device\n");
priv->pCrossbar = NULL;
}
@@ -2790,7 +2790,7 @@ static int init(priv_t * priv)
}
OLE_RELEASE_SAFE(pTVAudio);
if (FAILED(hr))
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TVI_DS_UnableSetAudioMode, priv->tv_param->amode,(unsigned int)hr);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "tvi_dshow: Unable to set audio mode %d. Error:0x%x\n", priv->tv_param->amode,(unsigned int)hr);
}
}
@@ -2828,19 +2828,19 @@ static int init(priv_t * priv)
}
if (!priv->chains[0]->pStreamConfig)
- mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TVI_DS_ChangingWidthHeightNotSupported);
+ mp_tmsg(MSGT_TV, MSGL_INFO, "tvi_dshow: Changing video width/height is not supported by device.\n");
if (!priv->chains[0]->arpmt[priv->chains[0]->nFormatUsed]
|| !extract_video_format(priv->chains[0]->arpmt[priv->chains[0]->nFormatUsed],
&(priv->fcc), &(priv->width),
&(priv->height))) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_ErrorParsingVideoFormatStruct);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to parse video format structure.\n");
break;
}
if (priv->chains[1]->arpmt[priv->chains[1]->nFormatUsed]) {
if (!extract_audio_format(priv->chains[1]->pmt, &(priv->samplerate), NULL, NULL)) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_ErrorParsingAudioFormatStruct);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to parse audio format structure.\n");
DisplayMediaType("audio format failed",priv->chains[1]->arpmt[priv->chains[1]->nFormatUsed]);
break;
}
@@ -2848,7 +2848,7 @@ static int init(priv_t * priv)
hr = OLE_QUERYINTERFACE(priv->pGraph, IID_IMediaControl,priv->pMediaControl);
if(FAILED(hr)){
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_UnableGetMediaControlInterface,(unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Unable to get IMediaControl interface. Error:0x%x\n",(unsigned int)hr);
break;
}
hr = OLE_CALL_ARGS(priv->pBuilder, FindInterface,
@@ -2908,7 +2908,7 @@ static int init(priv_t * priv)
OLE_RELEASE_SAFE(pVPOutPin);
if (FAILED(hr)) {
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_UnableTerminateVPPin, (unsigned int)hr);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Unable to terminate VideoPort pin with any filter in graph. Error:0x%x\n", (unsigned int)hr);
break;
}
}
@@ -2948,7 +2948,7 @@ static int init(priv_t * priv)
} while(0);
if (!result){
- mp_msg(MSGT_TV,MSGL_ERR, MSGTR_TVI_DS_GraphInitFailure);
+ mp_tmsg(MSGT_TV,MSGL_ERR, "tvi_dshow: Directshow graph initialization failure.\n");
uninit(priv);
}
return result;
@@ -3078,12 +3078,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
if (sscanf(tv_param->device, "%d", &a) == 1) {
priv->dev_index = a;
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_WrongDeviceParam, tv_param->device);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device parameter: %s\n", tv_param->device);
free_handle(h);
return NULL;
}
if (priv->dev_index < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_WrongDeviceIndex, a);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device index: %d\n", a);
free_handle(h);
return NULL;
}
@@ -3092,12 +3092,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
if (sscanf(tv_param->adevice, "%d", &a) == 1) {
priv->adev_index = a;
} else {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_WrongADeviceParam, tv_param->adevice);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice parameter: %s\n", tv_param->adevice);
free_handle(h);
return NULL;
}
if (priv->dev_index < 0) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_WrongADeviceIndex, a);
+ mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice index: %d\n", a);
free_handle(h);
return NULL;
}
@@ -3357,7 +3357,7 @@ static int control(priv_t * priv, int cmd, void *arg)
break;
if (!priv->chains[1]->arpmt[i]) {
//request not found. failing back to first available
- mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TVI_DS_SamplerateNotsupported, samplerate);
+ mp_tmsg(MSGT_TV, MSGL_WARN, "tvi_dshow: Samplerate %d is not supported by device. Failing back to first available.\n", samplerate);
i = 0;
}
if (priv->chains[1]->pmt)
diff --git a/stream/tvi_v4l.c b/stream/tvi_v4l.c
index e46f13797c..f5d4f08276 100644
--- a/stream/tvi_v4l.c
+++ b/stream/tvi_v4l.c
@@ -1657,7 +1657,7 @@ static void *video_grabber(void *data)
mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta = 0\n");
} else if ((interval - prev_interval < (long long)0.85e6/priv->fps)
|| (interval - prev_interval > (long long)1.15e6/priv->fps) ) {
- mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1lf fps\n",
+ mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1f fps\n",
(double)1e6/(interval - prev_interval));
}
}
@@ -1702,7 +1702,7 @@ static void *video_grabber(void *data)
}
}
- mp_msg(MSGT_TV, MSGL_DBG3, "\nfps = %lf, interval = %lf, a_skew = %f, corr_skew = %f\n",
+ mp_msg(MSGT_TV, MSGL_DBG3, "\nfps = %f, interval = %f, a_skew = %f, corr_skew = %f\n",
(interval != prev_interval) ? (double)1e6/(interval - prev_interval) : -1,
(double)1e-6*interval, (double)1e-6*xskew, (double)1e-6*skew);
mp_msg(MSGT_TV, MSGL_DBG3, "vcnt = %d, acnt = %d\n", priv->video_cnt, priv->audio_cnt);
diff --git a/stream/url.c b/stream/url.c
index 92e872e599..ff61edbc70 100644
--- a/stream/url.c
+++ b/stream/url.c
@@ -54,19 +54,19 @@ url_new(const char* url) {
if( url==NULL ) return NULL;
if (strlen(url) > (SIZE_MAX / 3 - 1)) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
escfilename=malloc(strlen(url)*3+1);
if (!escfilename ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
// Create the URL container
Curl = malloc(sizeof(URL_t));
if( Curl==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
@@ -78,7 +78,7 @@ url_new(const char* url) {
// Copy the url in the URL container
Curl->url = strdup(escfilename);
if( Curl->url==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
mp_msg(MSGT_OPEN,MSGL_V,"Filename for url is now %s\n",escfilename);
@@ -98,7 +98,7 @@ url_new(const char* url) {
pos1 = ptr1-escfilename;
Curl->protocol = malloc(pos1+1);
if( Curl->protocol==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->protocol, escfilename, pos1);
@@ -120,7 +120,7 @@ url_new(const char* url) {
int len = ptr2-ptr1;
Curl->username = malloc(len+1);
if( Curl->username==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->username, ptr1, len);
@@ -133,7 +133,7 @@ url_new(const char* url) {
Curl->username[ptr3-ptr1]='\0';
Curl->password = malloc(len2+1);
if( Curl->password==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy( Curl->password, ptr3+1, len2);
@@ -185,7 +185,7 @@ url_new(const char* url) {
// copy the hostname in the URL container
Curl->hostname = malloc(pos2-pos1+1);
if( Curl->hostname==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->hostname, ptr1, pos2-pos1);
@@ -200,7 +200,7 @@ url_new(const char* url) {
// copy the path/filename in the URL container
Curl->file = strdup(ptr2);
if( Curl->file==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
}
@@ -209,7 +209,7 @@ url_new(const char* url) {
if( Curl->file==NULL ) {
Curl->file = malloc(2);
if( Curl->file==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strcpy(Curl->file, "/");
@@ -287,7 +287,7 @@ url_escape_string_part(char *outbuf, const char *inbuf) {
*outbuf++=c; // already
// dont escape again
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_URL_StringAlreadyEscaped,c,c1,c2);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"String appears to be already escaped in url_escape %c%c1%c2\n",c,c1,c2);
// error as this should not happen against RFC 2396
// to escape a string twice
} else {
diff --git a/stream/vcd_read.h b/stream/vcd_read.h
index b31abc0401..bd07b02d1f 100644
--- a/stream/vcd_read.h
+++ b/stream/vcd_read.h
@@ -7,7 +7,7 @@
#include <sys/ioctl.h>
#include "mp_msg.h"
#include "stream.h"
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
//=================== VideoCD ==========================
#if defined(__linux__) || defined(sun) || defined(__bsdi__)
diff --git a/stream/vcd_read_fbsd.h b/stream/vcd_read_fbsd.h
index 01e51f7da5..ed0e6e49bc 100644
--- a/stream/vcd_read_fbsd.h
+++ b/stream/vcd_read_fbsd.h
@@ -6,7 +6,7 @@
#include <sys/types.h>
#include <inttypes.h>
#include <unistd.h>
-#include "libavutil/intreadwrite.h"
+#include "ffmpeg_files/intreadwrite.h"
#include <sys/cdio.h>
#include <sys/ioctl.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)