Skip to content

Commit

Permalink
[LINUX] fixed: Compile error on systems without libbluray installed
Browse files Browse the repository at this point in the history
  • Loading branch information
arnova committed Apr 11, 2012
1 parent 486dc68 commit 8d0d0b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
Expand Up @@ -33,7 +33,9 @@
#include "DVDDemuxFFmpeg.h"
#include "DVDInputStreams/DVDInputStream.h"
#include "DVDInputStreams/DVDInputStreamNavigator.h"
#ifdef HAVE_LIBBLURAY

This comment has been minimized.

Copy link
@arnova

arnova Apr 11, 2012

Member

That's weird?! I c&p'ed this from another place in DVDPlayer, which means it must be wrong there too. Are you sure?

This comment has been minimized.

Copy link
@arnova

arnova Apr 11, 2012

Member

Since Elupus did most of the stuff in here, better ask him.
@elupus: What do you think?

This comment has been minimized.

Copy link
@elupus

elupus Apr 11, 2012

Contributor

Hmm.. I must say I technically like the #if(DEFINE) instead of the #ifdef since the first way requires the define to exist.

But we tend to not do it that way in xbmc. So i think we should change configure here to be more in line with other stuff.

This comment has been minimized.

Copy link
@theuni

theuni Apr 11, 2012

Contributor

yes please leave it undefined. we use #ifdef foo or #if defined(foo) almost everywhere else, leaving this as #if foo will almost certainly lead to more c/p errors like this one.

though fwiw i agree.. would've been nice if we'd standardized on the other way.

This comment has been minimized.

Copy link
@elupus

elupus Apr 11, 2012

Contributor

AC_SUBST is for makefile stuff. not config defines. So it's not always defined like cptspiff said.

This comment has been minimized.

Copy link
@theuni

theuni Apr 11, 2012

Contributor

yep, I see now. Our convention lately is USE_ for those, changing to that might clear it up some.

#include "DVDInputStreams/DVDInputStreamBluray.h"
#endif
#include "DVDDemuxUtils.h"
#include "DVDClock.h" // for DVD_TIME_BASE
#include "utils/Win32Exception.h"
Expand Down
6 changes: 4 additions & 2 deletions xbmc/cores/dvdplayer/DVDFileInfo.cpp
Expand Up @@ -33,7 +33,9 @@
#include "DVDClock.h"
#include "DVDStreamInfo.h"
#include "DVDInputStreams/DVDInputStream.h"
#ifdef HAVE_LIBBLURAY
#include "DVDInputStreams/DVDInputStreamBluray.h"
#endif
#include "DVDInputStreams/DVDFactoryInputStream.h"
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
Expand Down Expand Up @@ -369,7 +371,7 @@ bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDem
} /* for iStream */

details.DetermineBestStreams();

#ifdef HAVE_LIBBLURAY
// correct bluray runtime. we need the duration from the input stream, not the demuxer.
if (pInputStream->IsStreamType(DVDSTREAM_TYPE_BLURAY))
{
Expand All @@ -378,7 +380,7 @@ bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDem
((CStreamDetailVideo*)details.GetNthStream(CStreamDetail::VIDEO,0))->m_iDuration = ((CDVDInputStreamBluray*)pInputStream)->GetTotalTime() / 1000;
}
}

#endif
return retVal;
}

0 comments on commit 8d0d0b3

Please sign in to comment.