summaryrefslogtreecommitdiffstats
path: root/stream/tv.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/tv.c')
-rw-r--r--stream/tv.c91
1 files changed, 49 insertions, 42 deletions
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;
}
}