summaryrefslogtreecommitdiffstats
path: root/libmpdemux/tv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/tv.c')
-rw-r--r--libmpdemux/tv.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c
index 5d32e4cfb9..6a90f31ac5 100644
--- a/libmpdemux/tv.c
+++ b/libmpdemux/tv.c
@@ -554,6 +554,27 @@ int tv_step_channel(tvi_handle_t *tvh, int direction)
return(1);
}
+int tv_set_channel(tvi_handle_t *tvh, char *channel)
+{
+ int i;
+ struct CHANLIST cl;
+
+ for (i = 0; i < chanlists[tvh->chanlist].count; i++)
+ {
+ cl = tvh->chanlist_s[i];
+// printf("count%d: name: %s, freq: %d\n",
+// i, cl.name, cl.freq);
+ if (!strcasecmp(cl.name, channel))
+ {
+ tvh->channel = i;
+ mp_msg(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;
+ }
+ }
+}
+
int tv_step_norm(tvi_handle_t *tvh)
{
return(1);