Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[mythtv-cmyth] Adapt SetBookmark.
Browse files Browse the repository at this point in the history
- Changed return type to bool.
- Adapt to cmyth_set_bookmark returns 0 on success
  • Loading branch information
janbar authored and fetzerch committed Oct 21, 2012
1 parent e6a36ad commit 126cad6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions addons/pvr.mythtv.cmyth/src/cppmyth/MythConnection.cpp
Expand Up @@ -358,11 +358,11 @@ MythFile MythConnection::ConnectPath(const CStdString &filename, const CStdStrin
return MythFile(file, *this);
}

int MythConnection::SetBookmark(MythProgramInfo &recording, long long bookmark)
bool MythConnection::SetBookmark(MythProgramInfo &recording, long long bookmark)
{
int retval;
CMYTH_CONN_CALL(retval, retval < 0, cmyth_set_bookmark(*m_conn_t, *recording.m_proginfo_t, bookmark));
return retval;
return retval >= 0;
}

long long MythConnection::GetBookmark(MythProgramInfo &recording)
Expand Down
2 changes: 1 addition & 1 deletion addons/pvr.mythtv.cmyth/src/cppmyth/MythConnection.h
Expand Up @@ -86,7 +86,7 @@ class MythConnection

// Bookmarks
long long GetBookmark(MythProgramInfo &recording);
int SetBookmark(MythProgramInfo &recording, long long bookmark);
bool SetBookmark(MythProgramInfo &recording, long long bookmark);

private:
boost::shared_ptr<MythPointerThreadSafe<cmyth_conn_t> > m_conn_t;
Expand Down
7 changes: 3 additions & 4 deletions addons/pvr.mythtv.cmyth/src/pvrclient-mythtv.cpp
Expand Up @@ -620,20 +620,19 @@ PVR_ERROR PVRClientMythTV::SetRecordingLastPlayedPosition(const PVR_RECORDING &r
}

// Write the bookmark
int retval = m_con.SetBookmark(it->second, frameOffset);
if (retval == 1)
if (m_con.SetBookmark(it->second, frameOffset))
{
if (g_bExtraDebug)
{
XBMC->Log(LOG_ERROR, "%s - Setting Bookmark successful: %d)", __FUNCTION__);
XBMC->Log(LOG_ERROR, "%s - Setting Bookmark successful", __FUNCTION__);
}
return PVR_ERROR_NO_ERROR;
}
else
{
if (g_bExtraDebug)
{
XBMC->Log(LOG_ERROR, "%s - Setting Bookmark failed: %d)", __FUNCTION__, retval);
XBMC->Log(LOG_ERROR, "%s - Setting Bookmark failed", __FUNCTION__);
}
return PVR_ERROR_FAILED;
}
Expand Down

0 comments on commit 126cad6

Please sign in to comment.