Permalink
Browse files

Merge pull request #1746 from FernetMenta/streams

dvdplayer: avoid resetting players on stream change (pvr)
  • Loading branch information...
2 parents e257883 + 56395a2 commit 5132cf8d6d8349c4203311aeaef39144833068ab @elupus elupus committed Nov 8, 2012
Showing with 11 additions and 11 deletions.
  1. +8 −8 xbmc/cores/dvdplayer/DVDPlayer.cpp
  2. +3 −3 xbmc/cores/dvdplayer/DVDPlayer.h
@@ -694,7 +694,7 @@ bool CDVDPlayer::OpenDemuxStream()
return true;
}
-void CDVDPlayer::OpenDefaultStreams()
+void CDVDPlayer::OpenDefaultStreams(bool reset)
{
// bypass for DVDs. The DVD Navigator has already dictated which streams to open.
if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
@@ -708,7 +708,7 @@ void CDVDPlayer::OpenDefaultStreams()
valid = false;
for(SelectionStreams::iterator it = streams.begin(); it != streams.end() && !valid; ++it)
{
- if(OpenVideoStream(it->id, it->source))
+ if(OpenVideoStream(it->id, it->source, reset))
valid = true;;
}
if(!valid)
@@ -723,7 +723,7 @@ void CDVDPlayer::OpenDefaultStreams()
for(SelectionStreams::iterator it = streams.begin(); it != streams.end() && !valid; ++it)
{
- if(OpenAudioStream(it->id, it->source))
+ if(OpenAudioStream(it->id, it->source, reset))
valid = true;
}
if(!valid)
@@ -800,7 +800,7 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream)
{
m_SelectionStreams.Clear(STREAM_NONE, STREAM_SOURCE_DEMUX);
m_SelectionStreams.Update(m_pInputStream, m_pDemuxer);
- OpenDefaultStreams();
+ OpenDefaultStreams(false);
return true;
}
@@ -2788,7 +2788,7 @@ void CDVDPlayer::ToFFRW(int iSpeed)
SetPlaySpeed(iSpeed * DVD_PLAYSPEED_NORMAL);
}
-bool CDVDPlayer::OpenAudioStream(int iStream, int source)
+bool CDVDPlayer::OpenAudioStream(int iStream, int source, bool reset)
{
CLog::Log(LOGNOTICE, "Opening audio stream: %i source: %i", iStream, source);
@@ -2827,7 +2827,7 @@ bool CDVDPlayer::OpenAudioStream(int iStream, int source)
return false;
}
}
- else
+ else if (reset)
m_dvdPlayerAudio.SendMessage(new CDVDMsg(CDVDMsg::GENERAL_RESET));
/* store information about stream */
@@ -2846,7 +2846,7 @@ bool CDVDPlayer::OpenAudioStream(int iStream, int source)
return true;
}
-bool CDVDPlayer::OpenVideoStream(int iStream, int source)
+bool CDVDPlayer::OpenVideoStream(int iStream, int source, bool reset)
{
CLog::Log(LOGNOTICE, "Opening video stream: %i source: %i", iStream, source);
@@ -2888,7 +2888,7 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source)
return false;
}
}
- else
+ else if (reset)
m_dvdPlayerVideo.SendMessage(new CDVDMsg(CDVDMsg::GENERAL_RESET));
/* store information about stream */
@@ -278,8 +278,8 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
virtual void OnExit();
virtual void Process();
- bool OpenAudioStream(int iStream, int source);
- bool OpenVideoStream(int iStream, int source);
+ bool OpenAudioStream(int iStream, int source, bool reset = true);
+ bool OpenVideoStream(int iStream, int source, bool reset = true);
bool OpenSubtitleStream(int iStream, int source);
bool OpenTeletextStream(int iStream, int source);
bool CloseAudioStream(bool bWaitForBuffers);
@@ -334,7 +334,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
bool OpenInputStream();
bool OpenDemuxStream();
- void OpenDefaultStreams();
+ void OpenDefaultStreams(bool reset = true);
void UpdateApplication(double timeout);
void UpdatePlayState(double timeout);

0 comments on commit 5132cf8

Please sign in to comment.