diff options
author | chriszero <zerov83@gmail.com> | 2015-09-27 15:52:23 +0200 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-09-27 15:52:23 +0200 |
commit | 004e8940e25c3bca2b9219a5494e80b3c9b3ab9c (patch) | |
tree | eb1e5b180bbbb6fcc265cc816b660dc64f6f7e52 /hlsPlayer.cpp | |
parent | f22f21bcacdd4b57b14e5400fe6a55cf83b268d3 (diff) | |
download | vdr-plugin-plex-004e8940e25c3bca2b9219a5494e80b3c9b3ab9c.tar.gz vdr-plugin-plex-004e8940e25c3bca2b9219a5494e80b3c9b3ab9c.tar.bz2 |
Own replay control for skinningdevelopment
Diffstat (limited to 'hlsPlayer.cpp')
-rw-r--r-- | hlsPlayer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hlsPlayer.cpp b/hlsPlayer.cpp index 4a19a2a..8e0892c 100644 --- a/hlsPlayer.cpp +++ b/hlsPlayer.cpp @@ -7,6 +7,7 @@ #include <pcrecpp.h> #include <algorithm> +#include <fstream> #include "Plexservice.h" #include "XmlObject.h" @@ -438,12 +439,20 @@ cHlsPlayer::cHlsPlayer(std::string startm3u8, plexclient::Video Video, int offse m_isBuffering = false; AudioIndexOffset = 1000; // Just a magic number m_tTimer.Set(1); + m_pDebugFile = NULL; + + m_pDebugFile = new std::ofstream(); + m_pDebugFile->open("debug.ts", std::ios::out); } cHlsPlayer::~cHlsPlayer() { dsyslog("[plex]: '%s'", __FUNCTION__); Cancel(); + if(m_pDebugFile) m_pDebugFile->close(); + delete m_pDebugFile; + m_pDebugFile = NULL; + delete m_pSegmentLoader; m_pSegmentLoader = NULL; Detach(); @@ -530,6 +539,10 @@ bool cHlsPlayer::DoPlay(void) uchar* toPlay = m_pSegmentLoader->m_pRingbuffer->Get(bytesAvaliable); if(bytesAvaliable >= TS_SIZE) { int playedBytes = PlayTs(toPlay, TS_SIZE, false); + // save stream to disk to debug data + if(m_pDebugFile) + m_pDebugFile-> write((char*)toPlay, playedBytes); + m_pSegmentLoader->m_pRingbuffer->Del(playedBytes); res = true; } else { |