summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-19 10:09:43 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-19 10:09:43 +0000
commitbfddb0aa03a57024070b78c2bb5c4a78d8391f9d (patch)
treec4ec16d7c465af8a988c3ef4e45fd4a555d97314 /libmpdemux
parent64cdb2097c15a2e387760a37011a133ff9e45da1 (diff)
downloadmpv-bfddb0aa03a57024070b78c2bb5c4a78d8391f9d.tar.bz2
mpv-bfddb0aa03a57024070b78c2bb5c4a78d8391f9d.tar.xz
add a TV_SET_CNANNEL command
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8495 b3059339-0415-0410-9bf9-f77b7e298cf2
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);