Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

pvr: fix too early finish of recordings #2491

Merged
merged 2 commits into from

3 participants

@FernetMenta
Collaborator

pvr recordings stopped right after input stream has detected eof.

@elupus
Collaborator
@FernetMenta
Collaborator

What part don't you like? I tried to remove this part:

      else if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER))
      {
        CDVDInputStreamPVRManager* pStream = static_cast<CDVDInputStreamPVRManager*>(m_pInputStream);

        if (pStream->IsLiveStream())
        {
          if (pStream->IsEOF())
            break;

          Sleep(100);
          continue;
        }
      }

But I think this breaks channel change for backends using ffmpeg. ReadPacket can return null during channel change. I think this is the reason why this was placed in.

@elupus
Collaborator
@FernetMenta
Collaborator

I removed the pvr block from dvdplayer and added the EOF check to NextStream.

...vdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
@@ -315,9 +315,14 @@ bool CDVDInputStreamPVRManager::UpdateItem(CFileItem& item)
if(m_bReopened)
{
- m_bReopened = false;
- m_eof = false;
- return NEXTSTREAM_RETRY;
+ if (IsEOF())
+ return NEXTSTREAM_NONE;
+ else
+ {
+ m_bReopened = false;
+ m_eof = false;
+ return NEXTSTREAM_RETRY;
+ }
@elupus Collaborator
elupus added a note

Hmm.. The NextStream functionality should be matching the SkipNext() funktion of the file interface. So this should really make use of that to check if it should do a RETRY or not Imho. But apart from that it looks alright.

@FernetMenta Collaborator

I checked the file interface but it does not have the information of pOtherStream which I am not familiar with. As far as I can see this is for Media Portal. Because I can't test with this backend I would rather not change this too much. Do you mind getting the change in like it is now?

@opdenkamp Collaborator

it's for mediaportal indeed

@elupus Collaborator
elupus added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@FernetMenta
Collaborator

elupus, I added the changes you proposed.

@elupus
Collaborator
@FernetMenta
Collaborator

I don't think that it has changed desired behavior.
@opdenkamp @margro can you verify?

@opdenkamp
Collaborator

i don't have mediaportal set up, and that's the only one that uses this i think, so i can't verify this right now. @margro could you do this please?

@elupus
Collaborator

Drop the IsLiveStream() addition from this pull then i'd say we merge it.

@FernetMenta
Collaborator

Done. Please merge if your are fine with it.

@elupus elupus merged commit e56dd63 into xbmc:master
@FernetMenta FernetMenta deleted the FernetMenta:recordings branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
19 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
@@ -45,7 +45,6 @@ CDVDInputStreamPVRManager::CDVDInputStreamPVRManager(IDVDPlayer* pPlayer) : CDVD
m_pLiveTV = NULL;
m_pOtherStream = NULL;
m_eof = true;
- m_bReopened = false;
m_iScanTimeout = 0;
}
@@ -311,23 +310,20 @@ bool CDVDInputStreamPVRManager::UpdateItem(CFileItem& item)
CDVDInputStream::ENextStream CDVDInputStreamPVRManager::NextStream()
{
- if(!m_pFile) return NEXTSTREAM_NONE;
+ if(!m_pFile)
+ return NEXTSTREAM_NONE;
- if(m_bReopened)
- {
- m_bReopened = false;
- m_eof = false;
- return NEXTSTREAM_RETRY;
- }
+ m_eof = IsEOF();
if (m_pOtherStream)
return m_pOtherStream->NextStream();
else if(m_pFile->SkipNext())
{
- m_eof = false;
- return NEXTSTREAM_OPEN;
+ if (m_eof)
+ return NEXTSTREAM_OPEN;
+ else
+ return NEXTSTREAM_RETRY;
}
-
return NEXTSTREAM_NONE;
}
@@ -380,7 +376,6 @@ bool CDVDInputStreamPVRManager::CloseAndOpen(const char* strFile)
if (Open(strFile, m_content))
{
- m_bReopened = true;
return true;
}
View
1  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h
@@ -98,7 +98,6 @@ class CDVDInputStreamPVRManager
XFILE::IRecordable* m_pRecordable;
bool m_eof;
std::string m_strContent;
- bool m_bReopened;
unsigned int m_iScanTimeout;
};
View
9 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -1174,15 +1174,6 @@ void CDVDPlayer::Process()
Sleep(100);
continue;
}
- else if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER))
- {
- CDVDInputStreamPVRManager* pStream = static_cast<CDVDInputStreamPVRManager*>(m_pInputStream);
- if (pStream->IsEOF())
- break;
-
- Sleep(100);
- continue;
- }
// make sure we tell all players to finish it's data
if(m_CurrentAudio.inited)
View
2  xbmc/filesystem/PVRFile.h
@@ -44,7 +44,7 @@ class CPVRFile
virtual void Close();
virtual unsigned int Read(void* buffer, int64_t size);
virtual CStdString GetContent() { return ""; }
- virtual bool SkipNext() { return true; }
+ virtual bool SkipNext() { return !m_isPlayRecording; }
virtual bool Delete(const CURL& url);
virtual bool Rename(const CURL& url, const CURL& urlnew);
Something went wrong with that request. Please try again.