Skip to content

Commit

Permalink
[player] Update FileItem state on external player closing
Browse files Browse the repository at this point in the history
With the introduction of this callback and changes to IPlayer time-
keeping it was forgotten to include this in CExternalPlayer, so the
playcount would not be updated when using this feature.

Fixes xbmc#14957.
  • Loading branch information
pkerling committed Dec 24, 2018
1 parent cc5fb97 commit fc14587
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "utils/XMLUtils.h"
#include "utils/log.h"
#include "utils/Variant.h"
#include "video/Bookmark.h"
#include "ServiceBroker.h"
#include "cores/AudioEngine/Interfaces/AE.h"
#include "cores/DataCacheCore.h"
Expand Down Expand Up @@ -368,6 +369,12 @@ void CExternalPlayer::Process()
}
#endif

CBookmark bookmark;
bookmark.totalTimeInSeconds = 1;
bookmark.timeInSeconds = (elapsedMillis / 1000 >= m_playCountMinTime) ? 1 : 0;
bookmark.player = m_name;
m_callback.OnPlayerCloseFile(m_file, bookmark);

/* Resume AE processing of XBMC native audio */
if (!CServiceBroker::GetActiveAE()->Resume())
{
Expand Down

1 comment on commit fc14587

@bigretromike
Copy link

Choose a reason for hiding this comment

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

Did the way ExternalPlayer works changed? does it still report self.GetTime() == 1.0 when it hits the given <playcountminimumtime> ? or how should we capture the fact that external player should mark our video from addon as watched ?

Please sign in to comment.