diff options
Diffstat (limited to 'stream/tv.c')
-rw-r--r-- | stream/tv.c | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/stream/tv.c b/stream/tv.c index ec67a171f1..6a54306bbe 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -83,7 +83,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_tmsg(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; } @@ -220,7 +220,7 @@ static int norm_from_string(tvi_handle_t *tvh, char* norm) if(ret!=TVI_CONTROL_UNKNOWN) { - mp_tmsg(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; } @@ -239,7 +239,7 @@ static int norm_from_string(tvi_handle_t *tvh, char* norm) else if (!strcasecmp(norm, "ntscjp")) return TV_NORM_NTSCJP; else { - mp_tmsg(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; } } @@ -248,7 +248,7 @@ static void parse_channels(tvi_handle_t *tvh) { char** channels = tvh->tv_param->channels; - mp_tmsg(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; @@ -288,7 +288,7 @@ static void parse_channels(tvi_handle_t *tvh) } } if (tv_channel_current->freq == 0) - mp_tmsg(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, '-'); @@ -328,9 +328,9 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm) { tvh->norm = norm_from_string(tvh, norm); - mp_tmsg(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_tmsg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); + mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n"); return 0; } tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param); @@ -341,9 +341,9 @@ static int tv_set_norm_i(tvi_handle_t *tvh, int norm) { tvh->norm = norm; - mp_tmsg(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_tmsg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); + mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n"); return 0; } @@ -368,7 +368,7 @@ static int open_tv(tvi_handle_t *tvh) if (funcs->control(tvh->priv, TVI_CONTROL_IS_VIDEO, 0) != TVI_CONTROL_TRUE) { - mp_tmsg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoVideoInputPresent); + mp_tmsg(MSGT_TV, MSGL_ERR, "Error: No video input present!\n"); return 0; } @@ -396,7 +396,14 @@ static int open_tv(tvi_handle_t *tvh) case IMGFMT_BGR15: break; default: - mp_tmsg(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); } @@ -434,7 +441,7 @@ static int open_tv(tvi_handle_t *tvh) tvh->tv_param->height = 480/tvh->tv_param->decimation; } mp_tmsg(MSGT_TV, MSGL_INFO, - MSGTR_TV_MJP_WidthHeight, tvh->tv_param->width, tvh->tv_param->height); + " MJP: width %d height %d\n", tvh->tv_param->width, tvh->tv_param->height); } #endif @@ -452,7 +459,7 @@ static int open_tv(tvi_handle_t *tvh) funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tvh->tv_param->width); else { - mp_tmsg(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); } } @@ -464,14 +471,14 @@ static int open_tv(tvi_handle_t *tvh) funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tvh->tv_param->height); else { - mp_tmsg(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_tmsg(MSGT_TV, MSGL_WARN, MSGTR_TV_NoTuner); + mp_tmsg(MSGT_TV, MSGL_WARN, "Selected input hasn't got a tuner!\n"); goto done; } @@ -487,15 +494,15 @@ static int open_tv(tvi_handle_t *tvh) } if (tvh->chanlist == -1) - mp_tmsg(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_tmsg(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_tmsg(MSGT_TV, MSGL_WARN, MSGTR_TV_ChannelFreqParamConflict); + mp_tmsg(MSGT_TV, MSGL_WARN, "You can't set frequency and channel simultaneously!\n"); goto done; } @@ -537,7 +544,7 @@ static int open_tv(tvi_handle_t *tvh) tv_channel_current = tv_channel_current->next; } - mp_tmsg(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)); @@ -552,14 +559,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_tmsg(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_tmsg(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]; @@ -569,7 +576,7 @@ static int open_tv(tvi_handle_t *tvh) { strcpy(tv_channel_last_real, cl.name); tvh->channel = i; - mp_tmsg(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; @@ -607,7 +614,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_tmsg(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) @@ -628,7 +635,7 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param) continue; h->tv_param=tv_param; - mp_tmsg(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:""); @@ -638,9 +645,9 @@ static tvi_handle_t *tv_begin(tv_param_t* tv_param) } if(tv_param->driver) - mp_tmsg(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_tmsg(MSGT_TV, MSGL_ERR, MSGTR_TV_DriverAutoDetectionFailed); + mp_tmsg(MSGT_TV, MSGL_ERR, "TV driver autodetection failed.\n"); return NULL; } @@ -755,7 +762,7 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer) case AF_FORMAT_MPEG2: case AF_FORMAT_AC3: default: - mp_tmsg(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; } @@ -785,7 +792,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_tmsg(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); @@ -841,7 +848,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_tmsg(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; @@ -862,7 +869,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_tmsg(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; @@ -873,7 +880,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_tmsg(MSGT_TV, MSGL_V, MSGTR_TV_CurrentFrequency, + mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n", *freq, (float)*freq/16); } return 1; @@ -889,7 +896,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_tmsg(MSGT_TV, MSGL_V, MSGTR_TV_CurrentFrequency, + mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n", freq, (float)freq/16); } tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param); @@ -933,7 +940,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_tmsg(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)); } @@ -945,7 +952,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_tmsg(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)); } @@ -965,7 +972,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_tmsg(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) { @@ -977,7 +984,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_tmsg(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); @@ -998,7 +1005,7 @@ int tv_set_channel_real(tvi_handle_t *tvh, char *channel) { if (!strcasecmp(cl.name, channel)) { tvh->channel = i; - mp_tmsg(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; @@ -1018,7 +1025,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_tmsg(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)); @@ -1036,7 +1043,7 @@ int tv_last_channel(tvi_handle_t *tvh) { tv_channel_last = tv_channel_current; tv_channel_current = tmp; - mp_tmsg(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)); @@ -1051,7 +1058,7 @@ int tv_last_channel(tvi_handle_t *tvh) { { strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name); tvh->channel = i; - mp_tmsg(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; @@ -1069,7 +1076,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_tmsg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); + mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n"); return 0; } } |