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

Fix playback when OMXPlayer is enabled #657

Closed
wants to merge 1 commit into from
Closed

Fix playback when OMXPlayer is enabled #657

wants to merge 1 commit into from

Conversation

dagwieers
Copy link

A lot of users on Raspberry Pi are affected by a playback issue when
OMXPlayer is enabled. On Raspberry Pi OMXPlayer improves playback of
various streams, but it totally breaks Netflix playback.

This fixes reports on #237, #274, #286, #319, #656

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes locally?

Screenshots (if appropriate):

[You can erase any parts of this template not applicable to your Pull Request.]

A lot of users on Raspberry Pi are affected by a playback issue when
OMXPlayer is enabled. On Raspberry Pi OMXPlayer improves playback of
various streams, but it totally breaks Netflix playback.
@dagwieers dagwieers mentioned this pull request Mar 26, 2019
1 task
@dagwieers
Copy link
Author

Hmm, it seemed to have worked once, but I cannot reproduce the fix. So I am not sure that this was what actually change behaviour (it could have been that it was still running when I switched OMXPlayer off).

@dagwieers
Copy link
Author

The only reliable way to do this is disabling OMXPlayer on playback, and restore the configuration after playback. Disabling before playback is quite easy, but restoring the configuration is not that easy it seems.

@dagwieers
Copy link
Author

def get_global_setting(setting):
    json_result = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.GetSettingValue", "params":{"setting":"%s"}, "id":1}' % setting)
    xbmc.log(msg='get_global_setting: ' + json_result, level=xbmc.LOGNOTICE)
    return json.loads(json_result)['result']['value']


def set_global_setting(setting, value):
    if value is True or value is False:
        json_result = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"%s","value":%s}, "id":2}' % (setting, 'true' if value else 'false'))
    else:
        json_result = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"%s","value":"%s"}, "id":2}' % (setting, value))
    xbmc.log(msg='set_global_setting: ' + json_result, level=xbmc.LOGNOTICE)
    return json.loads(json_result)

And then in before playback:

            omxplayer = get_global_setting('videoplayer.useomxplayer')
            set_global_setting('videoplayer.useomxplayer', False)
            self.play_video(
                video_id=params['video_id'],
                start_offset=params.get('start_offset', -1),
                infoLabels=params.get('infoLabels', {}))
            return True

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.

None yet

1 participant