Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for start and end paused #669

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dronus
Copy link

@dronus dronus commented Dec 18, 2018

Adds options to pause at first frame (written some time ago by bholmes451) and the last frame.

Pausing on first frame allow a player to start fast when needed on files that require some preloading, and start mulitple players running synchronously.

Pausing at the the last frame prevents the console to reappear and the audience to leave the room unnerded :-). It also allow for more complex schemes where two layered omxplayers are used for seamless playback of multiple files.

bholmes451 and others added 3 commits March 13, 2017 06:58
This function allows a user to start omxplayer in a paused state instead
of immediately starting playback of the video.  The user can then use
standard keyboard or dbus commands to begin playback manually.

To use this function add the command-line parameter: --start-paused to
the omxplayer command.

Example:

omxplayer -p -o hdmi --start-paused test.mkv

This will start the omxplayer, load the buffer to begin playback and
then pause.  To resume playback, press the key on the keyboard for
resume (by default this is the p or space keys), or send a dbus command.
omxplayer.cpp Outdated
@@ -1435,20 +1441,23 @@ int main(int argc, char *argv[])
break;
case KeyConfig::ACTION_PLAY:
m_Pause=false;
//m_start_paused=false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove commented out code

omxplayer.cpp Outdated
if(m_has_subtitle)
{
m_player_subtitles.Resume();
}
break;
case KeyConfig::ACTION_PAUSE:
m_Pause=true;
//m_start_paused=false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

omxplayer.cpp Outdated
if(m_has_subtitle)
{
m_player_subtitles.Pause();
}
break;
case KeyConfig::ACTION_PLAYPAUSE:
m_Pause = !m_Pause;
//m_start_paused = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@dronus
Copy link
Author

dronus commented Dec 19, 2018

I think that where some relics from an earlier implementation. Removed them.

@dronus
Copy link
Author

dronus commented Dec 19, 2018

Will also close #538 and #659 if merged.

@toozie21
Copy link

I am working on a home project that could use these additions. Since it isn't merged in, I will need to build it myself locally, are there any issues with that? Seemed like a simple enough change, so I got worried there was a reason the PR was still sitting open.

@heeplr
Copy link

heeplr commented Aug 18, 2019

Is there a reason this isn't merged, yet?
The code seems trivial and those features would vastly improve asynchronous control of omxplayer.

@avrovulcanxh607
Copy link

As those above have commented, a really useful feature here, why hasn't it been merged yet? Really want this feature for an upcoming project

@devcshort
Copy link

Really sucks this hasn't been merged yet. I also have a need for it.

@ASkirrow
Copy link

A great addition. Without it i'm gonna have to ditch omxplayer on my projects. Essential to pause at the end of the media. Any other work around to get this happening. I've tried to compile the new line but get bogged down with library error etc :-(

@smadds
Copy link

smadds commented Mar 25, 2020

Please can someone merge this fork back? Compiling the branch has so many errors, I just cant get it to install on my RPi

@schicki0815
Copy link

Please merge the functions start-pause und end-paused back. The functions are very simple but helpful. Thanks

DazB pushed a commit to DazB/omxplayer that referenced this pull request May 28, 2020
Comment on lines +1759 to +1762
m_av_clock->OMXResume();
m_Pause=true;
m_start_paused=false;
m_av_clock->OMXPause();
Copy link

@DazB DazB Jun 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my own experiments, I've found that only m_Pause=true; is needed, and the player will see that variable has changed and pause once it loops around.

A previous edit of this comment that suggested m_av_clock->OMXResume(); and m_av_clock->OMXPause(); may cause unwanted effects seems to have been related to something else, so I have edited this comment.

However I still think that this suggestion is cleaner and less likely to cause issues.

Suggested change
m_av_clock->OMXResume();
m_Pause=true;
m_start_paused=false;
m_av_clock->OMXPause();
m_Pause=true;
m_start_paused=false;

Copy link

@zasnicoff zasnicoff Jun 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DazB Could you update your prepare-native-raspbian.sh script? Having trouble here trying to compile... It appears that some packages should be replaced: libva1 -> libva2; git-core -> git; libssl1.0-dev -> libssl-dev

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zasnicoff. That's also an issue with omxplayer, and not to do with any changes I've made. I too had those issues when first compiling. I probably should update my own fork of prepare-native-raspbian.sh to remedy this, but since it only happens when first compiling I didn't get round to it. Appreciate the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.