
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi it's me again, who randomly either complains or posts a patch :-) This time
it's a patch.

Prelude: The Xserver on the box I usually watch videos fscked up the card and
I know from experience if I restart X, it will hang the machine, so I'd have
to reboot, but I'm in the middle of a dvd rip so am forced to watch dvds on my
notebook. And I use a keyboard there. And aviplay (mplayer as well) have these
cool feature that you can move inside the movie with arrow keys. With vlc you
have to unfullscreen, bring up the control interface and seek with mouse,
which requires a lot of precision if the dvd is 200 minutes long.

So I added this stuff. It's rather dirty (but effective and straightforward)
and I guess from other code I saw it could cause unpleasant things when you're
changing source while pushing keys (it doesn't mutex anything), but so what.

Right/Left Arrow -> +/- 5 sec
Up/Down -> +/- 1 min
PgUp/PgDn -> +/- 15 min
End/Home -> beginning / end, or strictly speaking, +/- 99999 seconds.
Space -> (un)pause

The seeking routine detects seeks outside of the stream so it's handled
correctly.

May I humbly suggest that certain "middleware" features (e.g. calculations for
seeking) be unified and put into a separate cathegory, so that it isn't
necessary to duplicate code in each interface and vout plugin? Or perhaps it
ain't that important anyway OTOH :-)

And I'd be very happy if someone fixed the ac3 decoder. Damn I'm complaining
again :-)

Oh fsck, the rip just finished and I can reboot anyway so I won't be using my
patch actually <g>.

Anyway, kudos to all developers, vlc simply rocks, thnx a lot!

Bye,

Peter Surda (Shurdeek) <shurdeek@panorama.sth.ac.at>, ICQ 10236103, +436505122023

--
                   Disc space - The final frontier.


-- Attached file included as plaintext by Listar --

diff -ur ../vlc/plugins/x11/vout_xvideo.c ../vlc-shurdeek/plugins/x11/vout_xvideo.c
--- ../vlc/plugins/x11/vout_xvideo.c	Fri Dec  7 19:33:08 2001
+++ ../vlc-shurdeek/plugins/x11/vout_xvideo.c	Sun Dec  9 02:15:37 2001
@@ -77,6 +77,16 @@
 
 #define GUID_YUV12_PLANAR 0x32315659
 
+#define seek(x) {\
+int i_tell=p_main->p_intf->p_input->stream.p_selected_area->i_tell;\
+i_tell += (x) * 50 * p_main->p_intf->p_input->stream.i_mux_rate;\
+if (i_tell < p_main->p_intf->p_input->stream.p_selected_area->i_start)\
+  i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_start;\
+if (i_tell > p_main->p_intf->p_input->stream.p_selected_area->i_size)\
+  i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_size;\
+input_Seek( p_main->p_intf->p_input, i_tell );\
+}
+
 
 /*****************************************************************************
  * vout_sys_t: video output X11 method descriptor
@@ -460,6 +470,34 @@
                      break;
                  case XK_Menu:
                      p_main->p_intf->b_menu_change = 1;
+                     break;
+                 case XK_Left:
+										 seek (-5);
+                     break;
+                 case XK_Right:
+										 seek (5);
+                     break;
+                 case XK_Up:
+										 seek (60);
+                     break;
+                 case XK_Down:
+										 seek (-60);
+                     break;
+                 case XK_Home:
+										 seek (-99999);
+                     break;
+                 case XK_End:
+										 seek (99999);
+                     break;
+                 case XK_Page_Up:
+										 seek (900);
+                     break;
+                 case XK_Page_Down:
+										 seek (-900);
+                     break;
+                 case XK_space:
+                    input_SetStatus( p_main->p_intf->p_input,
+                                     INPUT_STATUS_PAUSE );
                      break;
                  default:
                      /* "Normal Keys"


-- Attached file included as plaintext by Listar --

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8EsB8zogxsPZwLzcRApSMAKCbn92ZZPqFj4inU7v6ph1PkrDS6ACfdKtS
JZhb5of8f526UAgSigkPJxI=
=f5P+
-----END PGP SIGNATURE-----



