diff options
Diffstat (limited to 'stream')
41 files changed, 555 insertions, 541 deletions
diff --git a/stream/ai_alsa.c b/stream/ai_alsa.c index fb6d7ceb26..b06c84a6db 100644 --- a/stream/ai_alsa.c +++ b/stream/ai_alsa.c @@ -41,24 +41,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; @@ -79,14 +79,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); @@ -102,7 +102,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; } @@ -126,7 +126,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; } @@ -160,7 +160,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) { @@ -168,18 +168,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 f5cece4499..d55e98ded7 100644 --- a/stream/ai_alsa1x.c +++ b/stream/ai_alsa1x.c @@ -42,27 +42,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; @@ -72,7 +72,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; @@ -81,7 +81,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; @@ -89,12 +89,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; } @@ -104,7 +104,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; } @@ -116,7 +116,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; } @@ -140,7 +140,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; } @@ -174,7 +174,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) { @@ -182,18 +182,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 14e8a921c8..328e7bf6af 100644 --- a/stream/ai_oss.c +++ b/stream/ai_oss.c @@ -59,7 +59,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; } @@ -72,7 +72,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; } @@ -89,7 +89,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; } @@ -100,13 +100,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; } @@ -116,7 +116,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; } @@ -129,7 +129,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); } @@ -137,17 +137,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 4caf79856a..6a69b426d0 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" @@ -130,7 +130,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"); } } @@ -178,7 +178,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; } @@ -225,7 +225,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) { @@ -237,12 +237,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; } @@ -268,7 +268,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; } @@ -277,13 +277,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; } @@ -336,14 +336,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)); @@ -351,13 +351,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 { @@ -373,7 +373,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 } @@ -393,7 +393,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; } @@ -410,12 +410,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; } @@ -427,26 +427,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; } @@ -457,7 +457,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 ) { @@ -466,7 +466,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; } } @@ -487,7 +487,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; @@ -540,7 +540,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); @@ -555,7 +555,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; @@ -635,6 +635,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 f00f503372..5b92fdcead 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -26,6 +26,7 @@ #include "config.h" #include "mp_msg.h" #include "help_mp.h" +#include "options.h" #if HAVE_WINSOCK2_H #include <winsock2.h> @@ -41,7 +42,7 @@ #include "network.h" #include "tcp.h" -#include "libavutil/intreadwrite.h" +#include "ffmpeg_files/intreadwrite.h" #include "libmpdemux/asfguid.h" @@ -54,7 +55,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; @@ -125,11 +126,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; } /* @@ -162,9 +163,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; @@ -204,13 +202,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; } @@ -218,7 +216,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 ) { @@ -235,7 +233,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); @@ -376,34 +374,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); @@ -425,14 +423,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; @@ -525,7 +523,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"); @@ -567,7 +565,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; } @@ -628,7 +626,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" ); @@ -642,7 +640,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 ) { @@ -651,7 +649,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; } @@ -675,7 +673,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 ); @@ -706,7 +704,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; @@ -732,7 +730,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; @@ -754,7 +752,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 ) { @@ -772,7 +770,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++; @@ -798,7 +796,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. @@ -834,12 +832,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; @@ -847,7 +847,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; diff --git a/stream/audio_in.c b/stream/audio_in.c index 48e325706a..bb18f7db11 100644 --- a/stream/audio_in.c +++ b/stream/audio_in.c @@ -203,16 +203,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; } @@ -223,9 +223,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 2e2aadc3fe..98e5d93501 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -56,7 +56,6 @@ static void *ThreadProc(void *s); #include "stream.h" #include "cache2.h" -extern int use_gui; typedef struct { // constats: @@ -90,15 +89,13 @@ static int min_fill=0; int cache_fill_status=0; -static 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); } -static 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; @@ -144,8 +141,7 @@ static int cache_read(cache_vars_t *s, unsigned char *buf, int size) return total; } -static 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; @@ -388,7 +384,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 ); @@ -415,9 +411,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 d70f55070d..182ce3fe70 100644 --- a/stream/cdinfo.c +++ b/stream/cdinfo.c @@ -41,7 +41,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; } @@ -75,14 +75,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 9750d28478..c2108559de 100644 --- a/stream/network.c +++ b/stream/network.c @@ -119,7 +119,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) ); @@ -156,15 +156,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; } @@ -174,7 +174,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; } @@ -259,7 +259,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; } @@ -288,12 +288,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; } @@ -307,8 +307,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 ) { @@ -327,28 +333,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; @@ -384,7 +390,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 ); closesocket( fd ); fd = -1; } @@ -406,7 +412,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 ); @@ -466,7 +472,6 @@ 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/open.c b/stream/open.c index 2fa4c9fc99..f5323eb2fa 100644 --- a/stream/open.c +++ b/stream/open.c @@ -47,7 +47,9 @@ int dvd_title=0; // Open a new stream (stdin/file/vcd/url) -stream_t* open_stream(const char* filename,char** options, int* file_format){ +stream_t* open_stream(const char *filename, struct MPOpts *options, + int *file_format) +{ // Check if playlist or unknown if (*file_format != DEMUXER_TYPE_PLAYLIST){ *file_format=DEMUXER_TYPE_UNKNOWN; diff --git a/stream/pnm.c b/stream/pnm.c index 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 83cfdb02c8..93eccdd659 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -41,7 +41,7 @@ #include "network.h" #include "stream.h" #include "libmpdemux/demuxer.h" -#include "libavutil/intreadwrite.h" +#include "ffmpeg_files/intreadwrite.h" #include "m_option.h" #include "m_struct.h" @@ -50,7 +50,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; @@ -141,9 +143,11 @@ static const stream_info_t* const auto_open_streams[] = { NULL }; -static stream_t* open_stream_plugin(const stream_info_t* sinfo, const 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, + const char *filename, + int mode, struct MPOpts *options, + int *file_format, int *ret, + char **redirected_url) { void* arg = NULL; stream_t* s; @@ -161,18 +165,9 @@ static stream_t* open_stream_plugin(const stream_info_t* sinfo, const char* file 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); @@ -209,7 +204,9 @@ static stream_t* open_stream_plugin(const stream_info_t* sinfo, const char* file } -stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format) { +stream_t *open_stream_full(const char *filename, int mode, + struct MPOpts *options, int *file_format) +{ int i,j,l,r; const stream_info_t* sinfo; stream_t* s; @@ -239,7 +236,7 @@ stream_t* open_stream_full(const char* filename,int mode, char** options, int* f 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; @@ -251,7 +248,8 @@ stream_t* open_stream_full(const char* filename,int mode, char** options, int* f return NULL; } -stream_t* open_output_stream(const char* filename, char** options) { +stream_t *open_output_stream(const 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"); @@ -376,18 +374,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; } @@ -480,13 +482,16 @@ 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 7774651611..7d6619f75b 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -107,9 +107,12 @@ 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; -struct stream_st; +struct stream; typedef struct stream_info_st { const char *info; const char *name; @@ -118,7 +121,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 @@ -126,19 +129,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_* @@ -152,6 +155,7 @@ 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 @@ -285,6 +289,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; } @@ -311,17 +316,22 @@ 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(const char* filename,char** options,int* file_format); -stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format); -stream_t* open_output_stream(const char* filename,char** options); +stream_t *open_stream(const char *filename, struct MPOpts *options, + int *file_format); +stream_t *open_stream_full(const char *filename,int mode, + struct MPOpts *options, int *file_format); +stream_t *open_output_stream(const 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 2cb440a2ac..8f8e414e23 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -213,7 +213,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; @@ -229,7 +229,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); @@ -237,7 +237,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 47a0321e01..811a1c1570 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -102,7 +102,7 @@ static int read_toc(const char *dev) 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; } @@ -150,7 +150,7 @@ static int read_toc(const char *dev) OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD, NULL); if (rc) { - mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToReadTOC); + mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed to read TOC.\n"); return -1; } @@ -183,7 +183,7 @@ static int read_toc(const char *dev) DosClose(hcd); if (rc) { - mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_MPDEMUX_CDDB_FailedToReadTOC); + mp_tmsg(MSGT_OPEN, MSGL_ERR, "Failed to read TOC.\n"); return -1; } #else @@ -310,8 +310,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); @@ -375,21 +374,19 @@ static int cddb_http_request(char *command, 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; } @@ -401,10 +398,10 @@ static int cddb_http_request(char *command, 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); @@ -427,7 +424,7 @@ static int cddb_read_cache(cddb_data_t *cddb_data) file_fd = open(file_name, O_RDONLY | O_BINARY); 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; } @@ -441,14 +438,13 @@ static int 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; } @@ -481,9 +477,8 @@ static int 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; } } @@ -503,7 +498,7 @@ static int 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; } @@ -525,7 +520,7 @@ static int 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; } @@ -534,14 +529,14 @@ static int cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) 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); @@ -559,7 +554,7 @@ static int 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; @@ -567,7 +562,7 @@ static int 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; } @@ -588,7 +583,7 @@ static int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_da 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++; @@ -597,7 +592,7 @@ static int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_da 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); @@ -614,8 +609,7 @@ static int cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_da 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; } @@ -627,7 +621,7 @@ static int 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; } @@ -637,7 +631,7 @@ static int cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) 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); @@ -654,12 +648,11 @@ static int 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 @@ -677,11 +670,11 @@ 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; } @@ -694,7 +687,7 @@ static int cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_dat 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; } @@ -702,18 +695,18 @@ static int cddb_proto_level_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_dat 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; } @@ -729,7 +722,7 @@ static int cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_da 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; } @@ -739,10 +732,10 @@ static int cddb_freedb_sites_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_da 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; } @@ -796,8 +789,7 @@ static int 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; } @@ -824,8 +816,7 @@ int cddb_resolve(const char *dev, char **xmcd_file) if (cdtoc_last_track <= 0) { 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; } } @@ -839,7 +830,7 @@ int 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; } @@ -859,7 +850,7 @@ int cddb_resolve(const char *dev, char **xmcd_file) 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 aa6dfd45b9..a29783e4d5 100644 --- a/stream/stream_cue.c +++ b/stream/stream_cue.c @@ -159,8 +159,8 @@ static int cue_getTrackinfo(FILE *fd_cue, 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; } @@ -250,21 +250,21 @@ static int cue_find_bin (char *firstline) { } fd_bin = open(cur_name, O_RDONLY); if (fd_bin == -1) { - mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_MPDEMUX_CUEREAD_BinFilenameTested, - cur_name); + mp_tmsg(MSGT_OPEN,MSGL_STATUS, "[bincue] bin filename tested: %s\n", + cur_name); } } if (fd_bin == -1) { /* 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; } - mp_msg(MSGT_OPEN,MSGL_INFO, - MSGTR_MPDEMUX_CUEREAD_UsingBinFile, cur_name); + mp_tmsg(MSGT_OPEN,MSGL_INFO, + "[bincue] Using bin file %s.\n", cur_name); return fd_bin; } @@ -297,8 +297,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(); } @@ -350,8 +350,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; } @@ -360,8 +360,8 @@ static int cue_read_cue (char *in_cue_filename) if(! fgets( sLine, sizeof(sLine), 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; } @@ -377,8 +377,8 @@ static int cue_read_cue (char *in_cue_filename) /* red the next line and call our track finder */ if(! fgets( sLine, sizeof(sLine), 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; } @@ -387,8 +387,8 @@ static int cue_read_cue (char *in_cue_filename) { if (cue_getTrackinfo(fd_cue, 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; } @@ -396,8 +396,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; } @@ -498,8 +498,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, @@ -526,12 +526,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; } @@ -605,11 +605,14 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { cue_vcd_read_toc(); ret=cue_vcd_seek_to_track(stream, 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, (int)stream->end_pos); + mp_tmsg(MSGT_OPEN, MSGL_INFO, + "CUE stream_open, filename=%s, track=%d, " + "available tracks: %d -> %d\n", + filename, track, ret, (int)stream->end_pos); stream->fd = f; stream->type = STREAMTYPE_VCDBINCUE; diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 1fee28ad6c..0f65cd29bb 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -95,26 +95,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; @@ -170,7 +170,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; } @@ -178,7 +178,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; } @@ -213,14 +213,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; } @@ -249,8 +249,7 @@ static int dvd_next_cell(dvd_priv_t *d) { return next_cell; } -static 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) { @@ -370,8 +369,7 @@ read_next: return d->cur_pack-1; } -static 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; @@ -409,8 +407,7 @@ static void dvd_seek(dvd_priv_t *d, int pos) d->angle_seek=1; } -static 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); @@ -741,12 +738,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; } @@ -766,7 +763,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; } @@ -780,7 +777,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; @@ -817,9 +814,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); @@ -830,9 +827,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.. @@ -843,7 +840,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; } /** @@ -851,7 +848,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; } @@ -911,7 +908,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 ], @@ -925,7 +922,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 ); } /** @@ -957,13 +954,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); } /** @@ -1015,7 +1012,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 56c7ec20a0..8d1febb832 100644 --- a/stream/stream_dvd_common.c +++ b/stream/stream_dvd_common.c @@ -38,7 +38,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" }; @@ -65,13 +65,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; } @@ -104,14 +104,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 87d18f6d23..1ce40f5275 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -557,7 +557,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); @@ -575,7 +575,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); } @@ -590,7 +590,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 30d63001d0..37c0800369 100644 --- a/stream/stream_ffmpeg.c +++ b/stream/stream_ffmpeg.c @@ -27,7 +27,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 9fda32b185..a77d51d315 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -143,7 +143,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 HAVE_SETMODE setmode(fileno(stdin),O_BINARY); @@ -162,7 +162,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 37bc3be495..acf616acd4 100644 --- a/stream/stream_live555.c +++ b/stream/stream_live555.c @@ -85,7 +85,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_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 76088d180e..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; diff --git a/stream/stream_radio.h b/stream/stream_radio.h index 1af2f1f4b0..8e3df1edb9 100644 --- a/stream/stream_radio.h +++ b/stream/stream_radio.h @@ -55,11 +55,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 4c57176d2f..ff8ad192b7 100644 --- a/stream/stream_smb.c +++ b/stream/stream_smb.c @@ -136,14 +136,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 819c3e52ea..9c1d5df8f0 100644 --- a/stream/stream_vcd.c +++ b/stream/stream_vcd.c @@ -146,7 +146,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; } @@ -160,7 +160,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); @@ -168,7 +169,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 5dfaa8304f..2222cca1db 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -133,7 +133,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; } @@ -148,7 +148,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 ); @@ -156,7 +156,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; } @@ -183,7 +183,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; } @@ -192,7 +192,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 @@ -207,7 +207,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; } @@ -220,7 +220,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; @@ -231,7 +231,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 @@ -244,11 +244,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 e98730f2b6..cb44790bb6 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -99,7 +99,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; } @@ -236,7 +236,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; } @@ -255,7 +255,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; } } @@ -264,7 +264,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; @@ -304,7 +304,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, '-'); @@ -344,9 +344,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, @@ -358,9 +358,9 @@ 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; } @@ -386,7 +386,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; } @@ -414,7 +414,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); } @@ -451,8 +458,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 @@ -470,7 +477,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); } } @@ -482,14 +489,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; } @@ -505,15 +512,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; } @@ -555,7 +562,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)); @@ -570,14 +577,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]; @@ -587,7 +594,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; @@ -625,7 +632,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) @@ -646,7 +653,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:""); @@ -656,9 +663,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; } @@ -776,7 +783,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; } @@ -806,7 +813,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); @@ -864,7 +871,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; @@ -885,7 +892,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; @@ -896,7 +903,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; @@ -912,7 +919,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, @@ -957,7 +964,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)); } @@ -969,7 +976,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)); } @@ -989,7 +996,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) { @@ -1001,7 +1008,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); @@ -1022,7 +1029,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; @@ -1042,7 +1049,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)); @@ -1060,7 +1067,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)); @@ -1075,7 +1082,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; @@ -1093,7 +1100,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 3d039911ab..627540b09b 100644 --- a/stream/tvi_bsdbt848.c +++ b/stream/tvi_bsdbt848.c @@ -250,7 +250,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; } @@ -264,7 +264,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; } @@ -275,7 +275,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; @@ -291,7 +291,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; } @@ -305,7 +305,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; } @@ -334,7 +334,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; } @@ -422,20 +422,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; } @@ -443,7 +443,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 @@ -472,7 +472,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; } @@ -497,7 +497,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; } @@ -519,7 +519,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; } @@ -570,33 +570,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) @@ -608,7 +608,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; } @@ -618,7 +618,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; } @@ -636,7 +636,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; } @@ -654,7 +654,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; } @@ -662,7 +662,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; } @@ -672,7 +672,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; } @@ -697,7 +697,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; } @@ -711,7 +711,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; } @@ -728,7 +728,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; } @@ -736,7 +736,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; } @@ -831,7 +831,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; } @@ -871,7 +871,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 @@ -879,7 +879,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 354c0f541b..3a55f33e33 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 = 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; } @@ -2512,7 +2512,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); } } @@ -2529,7 +2529,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; @@ -2555,7 +2555,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); } } @@ -2572,7 +2572,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; } } @@ -2602,7 +2602,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; } } @@ -2643,12 +2643,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"); @@ -2721,7 +2721,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); @@ -2733,7 +2733,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; } @@ -2753,7 +2753,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; } @@ -2763,7 +2763,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; } @@ -2789,7 +2789,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); } } @@ -2827,19 +2827,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; } @@ -2847,7 +2847,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, @@ -2907,7 +2907,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; } } @@ -2947,7 +2947,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; @@ -3077,12 +3077,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; } @@ -3091,12 +3091,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; } @@ -3356,7 +3356,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 52a1ea76d8..be02c1176c 100644 --- a/stream/tvi_v4l.c +++ b/stream/tvi_v4l.c @@ -1673,7 +1673,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)); } } @@ -1718,7 +1718,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 62e3bdcf2a..04ec6947b8 100644 --- a/stream/url.c +++ b/stream/url.c @@ -69,19 +69,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; } @@ -93,7 +93,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); @@ -113,7 +113,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); @@ -135,7 +135,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); @@ -148,7 +148,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); @@ -200,7 +200,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); @@ -215,7 +215,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; } } @@ -224,7 +224,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, "/"); @@ -302,7 +302,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 2911186d20..f94c7ea297 100644 --- a/stream/vcd_read.h +++ b/stream/vcd_read.h @@ -25,7 +25,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 a9555f5b9e..d6fa56dc6d 100644 --- a/stream/vcd_read_fbsd.h +++ b/stream/vcd_read_fbsd.h @@ -24,7 +24,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__) |