Skip to content

Commit

Permalink
dvdplayer: allow demuxer signal to player that stream info has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Plate committed Sep 21, 2012
1 parent ad94545 commit 3661ddb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
Expand Up @@ -99,6 +99,7 @@ class CDemuxStream
ExtraSize = 0;
memset(language, 0, sizeof(language));
disabled = false;
changes = 0;
flags = FLAG_NONE;
}

Expand Down Expand Up @@ -130,6 +131,8 @@ class CDemuxStream
char language[4]; // ISO 639 3-letter language code (empty string if undefined)
bool disabled; // set when stream is disabled. (when no decoder exists)

int changes; // increment on change which player may need to know about

enum EFlags
{ FLAG_NONE = 0x0000
, FLAG_DEFAULT = 0x0001
Expand Down
12 changes: 8 additions & 4 deletions xbmc/cores/dvdplayer/DVDPlayer.cpp
Expand Up @@ -1278,7 +1278,8 @@ void CDVDPlayer::ProcessPacket(CDemuxStream* pStream, DemuxPacket* pPacket)

void CDVDPlayer::ProcessAudioData(CDemuxStream* pStream, DemuxPacket* pPacket)
{
if (m_CurrentAudio.stream != (void*)pStream)
if (m_CurrentAudio.stream != (void*)pStream
|| m_CurrentAudio.changes != pStream->changes)
{
/* check so that dmuxer hints or extra data hasn't changed */
/* if they have, reopen stream */
Expand Down Expand Up @@ -1326,7 +1327,8 @@ void CDVDPlayer::ProcessAudioData(CDemuxStream* pStream, DemuxPacket* pPacket)

void CDVDPlayer::ProcessVideoData(CDemuxStream* pStream, DemuxPacket* pPacket)
{
if (m_CurrentVideo.stream != (void*)pStream)
if (m_CurrentVideo.stream != (void*)pStream
|| m_CurrentVideo.changes != pStream->changes)
{
/* check so that dmuxer hints or extra data hasn't changed */
/* if they have reopen stream */
Expand Down Expand Up @@ -1358,7 +1360,8 @@ void CDVDPlayer::ProcessVideoData(CDemuxStream* pStream, DemuxPacket* pPacket)

void CDVDPlayer::ProcessSubData(CDemuxStream* pStream, DemuxPacket* pPacket)
{
if (m_CurrentSubtitle.stream != (void*)pStream)
if (m_CurrentSubtitle.stream != (void*)pStream
|| m_CurrentSubtitle.changes != pStream->changes)
{
/* check so that dmuxer hints or extra data hasn't changed */
/* if they have reopen stream */
Expand Down Expand Up @@ -1386,7 +1389,8 @@ void CDVDPlayer::ProcessSubData(CDemuxStream* pStream, DemuxPacket* pPacket)

void CDVDPlayer::ProcessTeletextData(CDemuxStream* pStream, DemuxPacket* pPacket)
{
if (m_CurrentTeletext.stream != (void*)pStream)
if (m_CurrentTeletext.stream != (void*)pStream
|| m_CurrentTeletext.changes != pStream->changes)
{
/* check so that dmuxer hints or extra data hasn't changed */
/* if they have, reopen stream */
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/dvdplayer/DVDPlayer.h
Expand Up @@ -67,6 +67,7 @@ class CCurrentStream
double dur; // last frame expected duration
CDVDStreamInfo hint; // stream hints, used to notice stream changes
void* stream; // pointer or integer, identifying stream playing. if it changes stream changed
int changes; // remembered counter from stream to track codec changes
bool inited;
bool started; // has the player started
const StreamType type;
Expand All @@ -89,6 +90,7 @@ class CCurrentStream
dur = DVD_NOPTS_VALUE;
hint.Clear();
stream = NULL;
changes = 0;
inited = false;
started = false;
startpts = DVD_NOPTS_VALUE;
Expand Down

0 comments on commit 3661ddb

Please sign in to comment.