summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/tv.c21
-rw-r--r--libmpdemux/tv.h2
2 files changed, 23 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);
diff --git a/libmpdemux/tv.h b/libmpdemux/tv.h
index 6afaf20a9a..4f2cb9e41c 100644
--- a/libmpdemux/tv.h
+++ b/libmpdemux/tv.h
@@ -148,6 +148,8 @@ int tv_step_channel(tvi_handle_t *tvh, int direction);
#define TV_CHANNEL_LOWER 1
#define TV_CHANNEL_HIGHER 2
+int tv_set_channel(tvi_handle_t *tvh, char *channel);
+
int tv_step_norm(tvi_handle_t *tvh);
int tv_step_chanlist(tvi_handle_t *tvh);