[MPlayer-users] tv_set_freq: feature req + patch

Eric Schmeddes erix at xotix.net
Sat Dec 28 11:06:02 CET 2002


The following patch adds the command 'tv_set_freq <float>'
in slave mode (MP_CMD = 87). It works like the undocumented
'tv_set_channel' command. Apply patch with:
1. cd MPlayer-0.90rc2
2. patch <patchfile -p1

---------8<---------------------------------------8<----------------
diff -Naur bad/input/input.c fix/input/input.c
--- bad/input/input.c   Mon Dec 23 01:37:42 2002
+++ fix/input/input.c   Sat Dec 28 00:22:06 2002
@@ -79,6 +79,7 @@
   { MP_CMD_TV_STEP_NORM, "tv_step_norm",0, { {-1,{0}} }  },
   { MP_CMD_TV_STEP_CHANNEL_LIST, "tv_step_chanlist", 0, { {-1,{0}} }  },
   { MP_CMD_TV_SET_CHANNEL, "tv_set_channel", 1, { { MP_CMD_ARG_STRING, {0}}, {-1,{0}}  }},
+  { MP_CMD_TV_SET_FREQ, "tv_set_freq", 1, { { MP_CMD_ARG_FLOAT, {0}}, {-1,{0}}  }},
 #endif
   { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {-1,{0}} } },
   { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } },
diff -Naur bad/input/input.h fix/input/input.h
--- bad/input/input.h   Mon Dec 23 01:37:42 2002
+++ fix/input/input.h   Sat Dec 28 00:20:41 2002
@@ -20,6 +20,7 @@
 #define MP_CMD_TV_STEP_NORM 18
 #define MP_CMD_TV_STEP_CHANNEL_LIST 19
 #define MP_CMD_TV_SET_CHANNEL 37
+#define MP_CMD_TV_SET_FREQ 87
 #define MP_CMD_VO_FULLSCREEN 20
 #define MP_CMD_SUB_POS 21
 #define MP_CMD_DVDNAV 22
diff -Naur bad/libmpdemux/tv.h fix/libmpdemux/tv.h
--- bad/libmpdemux/tv.h Thu Dec 19 10:09:43 2002
+++ fix/libmpdemux/tv.h Sat Dec 28 00:18:48 2002
@@ -148,6 +148,8 @@
 #define TV_CHANNEL_LOWER       1
 #define TV_CHANNEL_HIGHER      2
 
+int tv_set_freq(tvi_handle_t *tvh, unsigned long freq);
+
 int tv_set_channel(tvi_handle_t *tvh, char *channel);
 
 int tv_step_norm(tvi_handle_t *tvh);
diff -Naur bad/mplayer.c fix/mplayer.c
--- bad/mplayer.c       Mon Dec 23 01:54:58 2002
+++ fix/mplayer.c       Sat Dec 28 00:26:43 2002
@@ -2438,6 +2438,10 @@
       if (tv_param_on == 1)
        tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s);
     } break;
+    case MP_CMD_TV_SET_FREQ :  {
+      if (tv_param_on == 1)
+       tv_set_freq((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.f * 16);
+    } break;
     case MP_CMD_TV_STEP_NORM :  {
       if (tv_param_on == 1)
        tv_step_norm((tvi_handle_t*)(demuxer->priv));
---------8<---------------------------------------8<----------------




More information about the MPlayer-users mailing list