From fcdf57713c2b04be9e74b5b90ec2a5fadea46f68 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 10 Jan 2018 20:04:51 +0100 Subject: [PATCH] armbox eplayer: fix init jump Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/a6242fd2ad3c9d11a861d07037f8ad28083cad4c Author: TangoCash Date: 2018-01-10 (Wed, 10 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_libeplayer3.cpp | 5 ++++- libarmbox/playback_libeplayer3.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index 2888121..846190d 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -206,6 +206,7 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in } } playing = true; + first = true; player->output->Command(player, OUTPUT_OPEN, NULL); ret = (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0); if (ret && !isHTTP) @@ -424,7 +425,7 @@ bool cPlayback::GetPosition(int &position, int &duration) bool cPlayback::SetPosition(int position, bool absolute) { lt_info("%s %d\n", __func__, position); - if (!playing) + if (playing && first) { /* the calling sequence is: * Start() - paused @@ -433,6 +434,7 @@ bool cPlayback::SetPosition(int position, bool absolute) * so let's remember the initial jump position and later jump to it */ init_jump = position; + first = false; return false; } int64_t pos = (position / 1000.0); @@ -673,6 +675,7 @@ cPlayback::cPlayback(int num __attribute__((unused))) lt_info("%s\n", __func__); playing = false; decoders_closed = false; + first = false; } cPlayback::~cPlayback() diff --git a/libarmbox/playback_libeplayer3.h b/libarmbox/playback_libeplayer3.h index d0f1195..15b1b16 100644 --- a/libarmbox/playback_libeplayer3.h +++ b/libarmbox/playback_libeplayer3.h @@ -18,7 +18,7 @@ class cPlayback private: bool enabled; - bool playing; + bool playing, first; bool no_probe; int nPlaybackSpeed; int mAudioStream;