summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stream/tvi_bsdbt848.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/stream/tvi_bsdbt848.c b/stream/tvi_bsdbt848.c
index f363332558..9d19206a6d 100644
--- a/stream/tvi_bsdbt848.c
+++ b/stream/tvi_bsdbt848.c
@@ -63,6 +63,7 @@
#include "libaf/af_format.h"
#include "libmpcodecs/img_format.h"
#include "tv.h"
+#include "mp_msg.h"
static tvi_handle_t *tvi_init_bsdbt848(tv_param_t* tv_param);
/* information about this file */
@@ -230,7 +231,7 @@ static int control(priv_t *priv, int cmd, void *arg)
{
if(ioctl(priv->tunerfd, TVTUNER_GETFREQ, &priv->tunerfreq) < 0)
{
- perror("GETFREQ:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "TVTUNER_GETFREQ", strerror(errno));
return(TVI_CONTROL_FALSE);
}
@@ -244,7 +245,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->tunerfd, TVTUNER_SETFREQ, &priv->tunerfreq) < 0)
{
- perror("SETFREQ:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "TVTUNER_SETFREQ", strerror(errno));
return(0);
}
@@ -255,7 +256,7 @@ static int control(priv_t *priv, int cmd, void *arg)
int status;
if(ioctl(priv->tunerfd, TVTUNER_GETSTATUS, &status) < 0)
{
- perror("GETSTATUS:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "GETSTATUS", strerror(errno));
return(0);
}
*(int*)arg=(status & 0x02)? 100 : 0;
@@ -271,7 +272,7 @@ static int control(priv_t *priv, int cmd, void *arg)
{
if(ioctl(priv->btfd, METEORGINPUT, &priv->input) < 0)
{
- perror("GINPUT:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORGINPUT", strerror(errno));
return(TVI_CONTROL_FALSE);
}
@@ -285,7 +286,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSINPUT, &priv->input) < 0)
{
- perror("tunerfreq:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
return(0);
}
@@ -314,7 +315,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
{
- perror("invalidaudiorate");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848InvalidAudioRate, strerror(errno));
return(TVI_CONTROL_FALSE);
}
@@ -402,20 +403,20 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
- perror("format:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFMT", strerror(errno));
return(TVI_CONTROL_FALSE);
}
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- perror("geo:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSETGEO", strerror(errno));
return(0);
}
tmp_fps = priv->fps;
if(ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
- perror("fps:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
return(0);
}
@@ -423,7 +424,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)
{
- perror("audioid:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "BT848_SAUDIO", strerror(errno));
}
#endif
@@ -452,7 +453,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- perror("width:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
return(0);
}
@@ -477,7 +478,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- perror("height:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorSettingWidth, strerror(errno));
return(0);
}
@@ -499,7 +500,7 @@ static int control(priv_t *priv, int cmd, void *arg)
if(ioctl(priv->btfd, METEORSFPS, &priv->fps) < 0)
{
- perror("fps:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
return(0);
}
@@ -550,33 +551,33 @@ priv->btfd = open(priv->btdev, O_RDONLY);
if(priv->btfd < 0)
{
- perror("bktr open");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningBktrDev, strerror(errno));
priv->videoready = FALSE;
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSFMT, &priv->iformat) < 0)
{
- perror("FMT:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SETEORSFMT", strerror(errno));
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSINPUT, &priv->source) < 0)
{
- perror("SINPUT:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSINPUT", strerror(errno));
}
tmp_fps = priv->fps;
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSFPS, &tmp_fps) < 0)
{
- perror("SFPS:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSFPS", strerror(errno));
}
if(priv->videoready == TRUE &&
ioctl(priv->btfd, METEORSETGEO, &priv->geom) < 0)
{
- perror("SGEO:ioctl");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSGEQ", strerror(errno));
}
if(priv->videoready == TRUE)
@@ -588,7 +589,7 @@ if(priv->videoready == TRUE)
if(priv->livebuf == (u_char *) MAP_FAILED)
{
- perror("mmap");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848MmapFailed, strerror(errno));
priv->videoready = FALSE;
}
@@ -598,7 +599,7 @@ if(priv->videoready == TRUE)
if(priv->framebuf[count].buf == NULL)
{
- perror("framebufmalloc");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848FrameBufAllocFailed, strerror(errno));
priv->videoready = FALSE;
break;
}
@@ -616,7 +617,7 @@ priv->tunerfd = open(priv->tunerdev, O_RDONLY);
if(priv->tunerfd < 0)
{
- perror("tune open");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningTunerDev, strerror(errno));
priv->tunerready = FALSE;
}
@@ -634,7 +635,7 @@ priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps *
if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < 0)
{
- perror("dsp open");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorOpeningDspDev, strerror(errno));
priv->dspready = FALSE;
}
@@ -642,7 +643,7 @@ marg = (256 << 16) | 12;
if (ioctl(priv->dspfd, SNDCTL_DSP_SETFRAGMENT, &marg ) < 0 )
{
- perror("setfrag");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SNDCTL_DSP_SETFRAGMENT", strerror(errno));
priv->dspready = FALSE;
}
@@ -652,7 +653,7 @@ if((priv->dspready == TRUE) &&
(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &priv->dspspeed) == -1) ||
(ioctl(priv->dspfd, SNDCTL_DSP_SETFMT, &priv->dspfmt) == -1)))
{
- perror ("configuration of dsp failed");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorConfiguringDsp, strerror(errno));
close(priv->dspfd);
priv->dspready = FALSE;
}
@@ -677,7 +678,7 @@ marg = SIGUSR1;
if(ioctl(priv->btfd, METEORSSIGNAL, &marg) < 0)
{
- perror("METEORSSIGNAL failed");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
return(0);
}
@@ -691,7 +692,7 @@ marg = METEOR_CAP_CONTINOUS;
if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0)
{
- perror("METEORCAPTUR failed");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORCAPTUR", strerror(errno));
return(0);
}
@@ -708,7 +709,7 @@ marg = METEOR_SIG_MODE_MASK;
if(ioctl( priv->btfd, METEORSSIGNAL, &marg) < 0 )
{
- perror("METEORSSIGNAL");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "METEORSSIGNAL", strerror(errno));
return(0);
}
@@ -716,7 +717,7 @@ marg = METEOR_CAP_STOP_CONT;
if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 )
{
- perror("METEORCAPTUR STOP");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848UnableToStopCapture, strerror(errno));
return(0);
}
@@ -811,7 +812,7 @@ while(bytesread < len)
if(ret == -1)
{
- perror("Audio read failed!");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848ErrorReadingAudio, strerror(errno));
return 0;
}
@@ -851,7 +852,7 @@ if(priv->dspready == FALSE) return 0;
#ifdef USE_SUN_AUDIO
if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0)
{
- perror("AUDIO_GETINFO");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "AUDIO_GETINFO", strerror(errno));
return(TVI_CONTROL_FALSE);
}
else
@@ -859,7 +860,7 @@ else
#else
if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0)
{
- perror("FIONREAD");
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "FIONREAD", strerror(errno));
return(TVI_CONTROL_FALSE);
}
#endif