popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.02k stars 332 forks source link

Configurable time seek #142

Closed nohmad closed 10 years ago

nohmad commented 10 years ago

Key-config option exposes following actions:

SEEK_BACK_SMALL SEEK_FORWARD_SMALL SEEK_BACK_LARGE SEEK_FORWARD_LARGE

However these seeking times are fixed as constants in the code. Can you make users adjust those variables? I'll be just happy with either command line options or environment variables, or even dbus messages.

jehutting commented 10 years ago

Something like a command line option --seek "BL BS FS FL" with Back Large / Back Small / Forward Small / Forward Large values in seconds?

For D-Bus there is already a MediaPlayer2.Player.Seek method. Doesn't this work? Checked it. It isn't correctly implemented: a positive offset gives a forward small (with the fixed 30 sec) and a negative offset gives a backward small (also with a fixed value of 30 sec).

nohmad commented 10 years ago

@jehutting Yes, option like you brought might be sufficient.

I didn't know that dbus is already being supported. It'd be great if the method works accepting arbitrary integer second.

jehutting commented 10 years ago

You need a 0.3.? omxplayer release to use the D-Bus interface. For the implementation and usage see OMXControl.h & .cpp files, and the MPRIS2 specifications. Notice that not all of this spec. is implemented (e.g. the playlist functionality).

blakee commented 10 years ago

Have a look at https://github.com/blakee/omxplayer/tree/dbusfixes , I fixed Seek and added SetPosition.

popcornmix commented 10 years ago

@blakee Could you submit a PR? Looks good, but will require a little testing.

jehutting commented 10 years ago

Nice work @blakee. Your dbuscontrol.sh pops up at the right time. I was just looking for code to check the D-Bus interface! Thanks!

blakee commented 10 years ago

Submitted PR #146

popcornmix commented 10 years ago

This is now implemented. Updated omxplayer here http://omxplayer.sconde.net. Can you test? Try: pi@raspberrypi:~ $ ./dbuscontrol.sh setposition 30000000 to seek to 30 seconds (using this https://github.com/popcornmix/omxplayer/blob/master/dbuscontrol.sh)

nohmad commented 10 years ago

@popcornmix It works nice. I also tested seek subcommand with negative number, and it works as I expected.

Thanks for @blakee and @popcornmix.

popcornmix commented 10 years ago

Good to hear.