Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Cores] Spring cleaning #2444

Merged
29 commits merged into from

9 participants

@ace20022
Collaborator

This time I Cppcheck-ed the whole cores folder.

@ace20022
Collaborator

Implemented @cptspiff suggestions. Can you check if it's OK so: 46e221db883ecc259f5611bfd422eb7e3d56415b

@akva2

it's what i had in mind. if it still compiles, it's all good.

@akva2

argh, wrong id, ^^ cptspiff at work.

@ace20022
Collaborator

yes it does, thanks.

@ghost

rebase

@ace20022
Collaborator

Will do tomorrow morning. If this is ready to merge already, I will remove the tags while rebasing. (?)

@ace20022
Collaborator

@cptspiff rebased.

@akva2

thanks squash it up and i'll hit the green and shiny.

@ace20022
Collaborator

Just to be sure, squash the most recently with their "partners" or squash all 31 commits into one?

@jmarshallnz
Owner

The former.

ace20022 added some commits
@ace20022 ace20022 [DVDOverlay] Correct comments. 1fc1595
@ace20022 ace20022 [DVDOverlay] Correct the loop in the OverlayGroup copy constructor. 07430e3
@ace20022 ace20022 [DVDPlayerAudioResampler] Check for realloc failures, NO free() calls. 7afd4de
@ace20022 ace20022 [CrytalHD/OpenMax] Fix "Common realloc mistake: 'out' nulled but not …
…freed upon failure".
e32f111
@ace20022 ace20022 [Cores] Initialize members in the constructors. 92e8bc4
@ace20022 ace20022 [EmuFileWrapper] Remove unused member variable m_initialized. c43f5ba
@ace20022 ace20022 [DVDStreamInfo] Complete Assign(...) method. 85df0e2
@ace20022 ace20022 [DVDSubtitleTagSami] Possible leak in public function. f54dbb0
@ace20022 ace20022 [Cores] Make LibraryLoader and CConvolutionKernel non-copyable. 7a8a734
@ace20022 ace20022 [Cores] Performance: pre-increment/decrement instead of post-incremen…
…t/decrement.
6152735
@ace20022 ace20022 [Cores] Performance: use empty() instead of size() where appropriate. db67c5e
@ace20022 ace20022 [WinRenderer] Remove redundant assignments. c2fd5d8
@ace20022 ace20022 [Cores] Remove redundant assignments. 658ef93
@ace20022 ace20022 [Cores] Use initialization list. 666cf54
@ace20022 ace20022 [Cores] Remove unused structs and struct members. 64089f0
@ace20022 ace20022 [BaseRenderer] Remove unused var newWidth. cff8eb7
@ace20022 ace20022 [Cores] Remove unused vars. 1f73903
@ace20022 ace20022 [MP3codec] Remove unused var bpf and a switch block manipulation it. 24c0439
@ace20022 ace20022 [Cores] Reduce scope of variables. 3b9014d
@ace20022 ace20022 [Cores] Remove redundant predicates in conditions. e575a7f
@ace20022 ace20022 [PlayerCoreFactory] Fix 'CDVDStreamInfo::operator=' should return 'CD…
…VDStreamInfo &'.
b9d0c4d
@ace20022 ace20022 [DVDStreamInfo] Discuss: 'CDVDStreamInfo::operator=' should return 'C…
…DVDStreamInfo &'. See comment in code.
5dc64ae
@ace20022 ace20022 [Cores] Add constructors where recommended. 34e486d
@ace20022 ace20022 [WinRenderer] Performance: change order of predicates in condition. 6dbf6fb
@ace20022 ace20022 [OMXVideo] Same expression on both sides of '-'. Set it directly to z…
…ero.
ee942ec
@ace20022 ace20022 [Cores] Fix possible NULL pointer dereferences. 0914fd7
@ace20022 ace20022 [Cores] Performance: use static functions if possible. 7258bf7
@ace20022 ace20022 [Cores] Order init lists correctly. 712c3f8
@ace20022 ace20022 [OMXPlayer] Performance: Remove unnecessary NULL pointer checks. 8569e42
@ace20022
Collaborator

@cptspiff done ;)

@ghost ghost merged commit 31a41b8 into xbmc:master
@ace20022 ace20022 deleted the ace20022:cleanup_cores branch
@ace20022
Collaborator

@cptspiff I just found this by re-checking the folder with a new version of cppcheck. It was really foolish on my part to commit it this way.
What do think about the warning?

damm, i forgot about this one. operator= should indeed return a reference so we can do stuff like a = b = c.

@manio

Hello
This commit broke playing PVR radio channels for me.
I've got in the log an assert:

*__GI___assert_fail (assertion=0x10ce200 "m_iSourceChannels > 0 && m_iSourceChannels < 3", file=, line=220, function=0x10ce280 "virtual CAEChannelInfo CDVDAudioCodecLibMad::GetChannelMap()") at assert.c:81

Full debug: http://skyboo.net/xbmc/xbmc_crashlog-20130410_190044.log

After reverting it - it plays fine.

Collaborator

I've opened a pr here: #2588. I'm really sorry!

np, thank you for a quick fix :)

@popcornmix

if m_tAudio=-1 and item.IsAudio()=1 the old code continues, then new code returns.

Collaborator

Damn operator precedence and unreadable conditions, tricked me and cppcheck...

Collaborator

@cptspiff Revert the whole block?

I'd revert the entire block to fix the breakage and then try again with another PR.

@FernetMenta
Collaborator

backport to Frodo? I think this fixes trac 14334 (Rapidly changing live TV channel crashes XBMC)

Collaborator

If someone could create a patch that applies cleanly on top of the latest Frodo branch I could try it to see if it fixes the issue. I don't have enough git-fu to do it myself.

Collaborator

not sure if it applies cleanly:
git checkout -b Frodo origin/Frodo ; git show 92e8bc4a4361d730abac9ad3080cd6923e9d551a | git apply

edit:
as @cptspiff pointed out, i was sleepy when i wrote this i guess, git cherry-pick would have done the trick too :)

Collaborator

@opdenkamp some parts of the patch won't apply:

sam@gorbachov:/usr/src/xbmc$ git reset --hard
HEAD is now at 32b1a5e bump version to 12.2
sam@gorbachov:/usr/src/xbmc$ git show 92e8bc4 | git apply
:286: trailing whitespace.

:485: trailing whitespace.
m_flush = false;

error: patch failed: xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp:208
error: xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp: patch does not apply
error: patch failed: xbmc/cores/omxplayer/OMXVideo.cpp:86
error: xbmc/cores/omxplayer/OMXVideo.cpp: patch does not apply
sam@gorbachov:/usr/src/xbmc$

I modified the patch to leave those two untouched then recompiled and it seems to (at least partially) fix #14334. More info on trac.

@all, I won't accept a shotgun attempt as a backport to Frodo, find which bits really fix trac 14334 and that I will accept.

Collaborator

This whole commit is a fix so I don't see why backporting would be an issue. I don't have time to do more testing today but I could try to pin-point which file needs patching (I suspect xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp) tomorrow.

Collaborator

it's definitely a good idea to have this backported to frodo

It's a problem in that it introduces possible unknown issues that might cause regressions. This is not a fix that is aimed at fixing a specific issue. This is a shotgun patch and I don't accept shotgun patches this late in the release schedule. Since I am the Release Manager for Frodo, I am in control of what goes in and I've already given my thoughts on this.

Collaborator

sure, you are in control of the release, and i respect that. i was just giving my thoughts about this one.

if something in frodo depends on uninitialised variables with random content, and we break that by assigning them in constructors so mem is no longer uninitialised, then that would be very very odd ;-)

Collaborator

That couple of lines in vdpau.cpp are the interesting part for trac 14334:

+  past[0] = NULL;
+  past[1] = NULL;
+  current = NULL;
+  future = NULL; 

yes, very very odd but not impossible and I'm not risking a release to find out.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2013
  1. @ace20022
  2. @ace20022
  3. @ace20022
  4. @ace20022
  5. @ace20022
  6. @ace20022
  7. @ace20022
  8. @ace20022
  9. @ace20022
  10. @ace20022
  11. @ace20022
  12. @ace20022
  13. @ace20022
  14. @ace20022
  15. @ace20022
  16. @ace20022
  17. @ace20022

    [Cores] Remove unused vars.

    ace20022 authored
  18. @ace20022
  19. @ace20022
  20. @ace20022
  21. @ace20022
  22. @ace20022

    [DVDStreamInfo] Discuss: 'CDVDStreamInfo::operator=' should return 'C…

    ace20022 authored
    …DVDStreamInfo &'. See comment in code.
  23. @ace20022
  24. @ace20022
  25. @ace20022
  26. @ace20022
  27. @ace20022
  28. @ace20022
  29. @ace20022
This page is out of date. Refresh to see the latest.
Showing with 502 additions and 319 deletions.
  1. +1 −1  xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioGraph.h
  2. +8 −8 xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
  3. +7 −7 xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
  4. +3 −3 xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h
  5. +16 −1 xbmc/cores/DllLoader/DllLoader-linux.cpp
  6. +0 −5 xbmc/cores/DllLoader/DllLoader.cpp
  7. +2 −0  xbmc/cores/DllLoader/LibraryLoader.h
  8. +0 −1  xbmc/cores/DllLoader/Win32DllLoader.cpp
  9. +2 −1  xbmc/cores/DllLoader/coff.cpp
  10. +4 −4 xbmc/cores/DllLoader/coffldr.h
  11. +2 −2 xbmc/cores/DllLoader/dll_tracker.cpp
  12. +0 −7 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
  13. +0 −6 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
  14. +0 −1  xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
  15. +0 −1  xbmc/cores/DllLoader/ldt_keeper.c
  16. +4 −0 xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  17. +1 −3 xbmc/cores/VideoRenderers/BaseRenderer.cpp
  18. +1 −1  xbmc/cores/VideoRenderers/BaseRenderer.h
  19. +19 −6 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
  20. +21 −14 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
  21. +3 −3 xbmc/cores/VideoRenderers/OverlayRenderer.cpp
  22. +1 −0  xbmc/cores/VideoRenderers/OverlayRenderer.h
  23. +9 −5 xbmc/cores/VideoRenderers/RenderManager.cpp
  24. +5 −4 xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h
  25. +6 −2 xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
  26. +14 −1 xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.h
  27. +43 −36 xbmc/cores/VideoRenderers/WinRenderer.cpp
  28. +1 −0  xbmc/cores/VideoRenderers/WinRenderer.h
  29. +2 −0  xbmc/cores/VideoRenderers/legacy/ComboRenderer.cpp
  30. +2 −0  xbmc/cores/VideoRenderers/legacy/RGBRendererV2.cpp
  31. +42 −18 xbmc/cores/amlplayer/AMLPlayer.cpp
  32. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp
  33. +3 −1 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.cpp
  34. +5 −0 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
  35. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
  36. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
  37. +6 −6 xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h
  38. +1 −4 xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodec.h
  39. +10 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
  40. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.h
  41. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
  42. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h
  43. +10 −4 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp
  44. +10 −1 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h
  45. +5 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
  46. +3 −1 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
  47. +3 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
  48. +4 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMax.cpp
  49. +13 −4 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp
  50. +6 −6 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
  51. +27 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
  52. +1 −1  xbmc/cores/dvdplayer/DVDDemuxSPU.cpp
  53. +2 −2 xbmc/cores/dvdplayer/DVDDemuxSPU.h
  54. +1 −1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxHTSP.cpp
  55. +1 −0  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp
  56. +1 −3 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxShoutcast.cpp
  57. +4 −4 xbmc/cores/dvdplayer/DVDFileInfo.cpp
  58. +1 −1  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp
  59. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h
  60. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamHTSP.cpp
  61. +1 −2  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
  62. +5 −1 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h
  63. +1 −1  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
  64. +1 −1  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h
  65. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp
  66. +1 −1  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.h
  67. +1 −1  xbmc/cores/dvdplayer/DVDMessage.h
  68. +4 −5 xbmc/cores/dvdplayer/DVDMessageQueue.cpp
  69. +2 −2 xbmc/cores/dvdplayer/DVDMessageTracker.cpp
  70. +5 −5 xbmc/cores/dvdplayer/DVDOverlayContainer.cpp
  71. +1 −1  xbmc/cores/dvdplayer/DVDPerformanceCounter.h
  72. +4 −4 xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
  73. +22 −4 xbmc/cores/dvdplayer/DVDPlayerAudioResampler.cpp
  74. +1 −1  xbmc/cores/dvdplayer/DVDPlayerSubtitle.cpp
  75. +1 −1  xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
  76. +6 −6 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
  77. +2 −0  xbmc/cores/dvdplayer/DVDStreamInfo.cpp
  78. +3 −0  xbmc/cores/dvdplayer/DVDStreamInfo.h
  79. +1 −4 xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleParser.h
  80. +5 −0 xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleTagMicroDVD.h
  81. +2 −0  xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleTagSami.cpp
  82. +3 −3 xbmc/cores/dvdplayer/DVDTSCorrection.cpp
  83. +1 −1  xbmc/cores/dvdplayer/Edl.cpp
  84. +4 −6 xbmc/cores/omxplayer/OMXAudio.cpp
  85. +1 −0  xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
  86. +3 −3 xbmc/cores/omxplayer/OMXAudioCodecOMX.h
  87. +2 −3 xbmc/cores/omxplayer/OMXImage.cpp
  88. +2 −2 xbmc/cores/omxplayer/OMXPlayer.cpp
  89. +15 −0 xbmc/cores/omxplayer/OMXPlayerAudio.cpp
  90. +8 −3 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
  91. +11 −7 xbmc/cores/omxplayer/OMXVideo.cpp
  92. +6 −0 xbmc/cores/paplayer/AudioDecoder.cpp
  93. +2 −21 xbmc/cores/paplayer/MP3codec.cpp
  94. +1 −1  xbmc/cores/paplayer/MP3codec.h
  95. +1 −1  xbmc/cores/paplayer/OggCallback.h
  96. +0 −1  xbmc/cores/paplayer/VGMCodec.cpp
  97. +8 −8 xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
  98. +1 −1  xbmc/cores/playercorefactory/PlayerCoreFactory.h
  99. +12 −12 xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
  100. +3 −3 xbmc/cores/playercorefactory/PlayerSelectionRule.h
View
2  xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioGraph.h
@@ -46,7 +46,7 @@ class CCoreAudioGraph
bool Close();
bool Start();
bool Stop();
- AudioChannelLayoutTag GetChannelLayoutTag(int layout);
+ static AudioChannelLayoutTag GetChannelLayoutTag(int layout);
bool SetInputSource(ICoreAudioSource *pSource);
bool SetCurrentVolume(Float32 vol);
CAUOutputDevice* DestroyUnit(CAUOutputDevice *outputUnit);
View
16 xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -113,19 +113,19 @@ static BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCTSTR lpcstrDescription, LP
}
CAESinkDirectSound::CAESinkDirectSound() :
- m_initialized (false),
- m_isDirtyDS (false),
m_pBuffer (NULL ),
m_pDSound (NULL ),
- m_BufferOffset (0 ),
- m_CacheLen (0 ),
- m_dwChunkSize (0 ),
- m_dwBufferLen (0 ),
- m_BufferTimeouts(0 ),
m_AvgBytesPerSec(0 ),
+ m_dwChunkSize (0 ),
m_dwFrameSize (0 ),
+ m_dwBufferLen (0 ),
+ m_BufferOffset (0 ),
+ m_CacheLen (0 ),
m_LastCacheCheck(0 ),
- m_running (false)
+ m_BufferTimeouts(0 ),
+ m_running (false),
+ m_initialized (false),
+ m_isDirtyDS (false)
{
m_channelLayout.Reset();
}
View
14 xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
@@ -176,21 +176,21 @@ CStdStringA localWideToUtf(LPCWSTR wstr)
}
CAESinkWASAPI::CAESinkWASAPI() :
- m_pAudioClient(NULL),
- m_pRenderClient(NULL),
m_needDataEvent(0),
m_pDevice(NULL),
- m_initialized(false),
- m_running(false),
+ m_pAudioClient(NULL),
+ m_pRenderClient(NULL),
m_encodedFormat(AE_FMT_INVALID),
m_encodedChannels(0),
m_encodedSampleRate(0),
- m_uiBufferLen(0),
- m_avgTimeWaiting(50),
- m_isDirty(false),
sinkReqFormat(AE_FMT_INVALID),
sinkRetFormat(AE_FMT_INVALID),
+ m_running(false),
+ m_initialized(false),
m_isSuspended(false),
+ m_isDirty(false),
+ m_uiBufferLen(0),
+ m_avgTimeWaiting(50),
m_sinkLatency(0.0)
{
m_channelLayout.Reset();
View
6 xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h
@@ -49,9 +49,9 @@ class CAESinkWASAPI : public IAESink
private:
bool InitializeExclusive(AEAudioFormat &format);
void AEChannelsFromSpeakerMask(DWORD speakers);
- DWORD SpeakerMaskFromAEChannels(const CAEChannelInfo &channels);
- void BuildWaveFormatExtensible(AEAudioFormat &format, WAVEFORMATEXTENSIBLE &wfxex);
- void BuildWaveFormatExtensibleIEC61397(AEAudioFormat &format, WAVEFORMATEXTENSIBLE_IEC61937 &wfxex);
+ static DWORD SpeakerMaskFromAEChannels(const CAEChannelInfo &channels);
+ static void BuildWaveFormatExtensible(AEAudioFormat &format, WAVEFORMATEXTENSIBLE &wfxex);
+ static void BuildWaveFormatExtensibleIEC61397(AEAudioFormat &format, WAVEFORMATEXTENSIBLE_IEC61937 &wfxex);
static const char *WASAPIErrToStr(HRESULT err);
View
17 xbmc/cores/DllLoader/DllLoader-linux.cpp
@@ -22,7 +22,22 @@
#include "DllLoader.h"
#include "DllLoaderContainer.h"
-CoffLoader::CoffLoader()
+CoffLoader::CoffLoader() :
+ hModule (NULL ),
+ CoffFileHeader (NULL ),
+ OptionHeader (NULL ),
+ WindowsHeader (NULL ),
+ Directory (NULL ),
+ SectionHeader (NULL ),
+ SymTable (NULL ),
+ StringTable (NULL ),
+ SectionData (NULL ),
+ EntryAddress (0 ),
+ NumberOfSymbols (0 ),
+ SizeOfStringTable (0 ),
+ NumOfDirectories (0 ),
+ NumOfSections (0 ),
+ FileHeaderOffset (0 )
{
}
View
5 xbmc/cores/DllLoader/DllLoader.cpp
@@ -32,11 +32,6 @@ extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode);
#define fopen_utf8 fopen
#endif
-typedef struct _UNICODE_STRING {
- USHORT Length;
- USHORT MaximumLength;
- PWSTR Buffer;
-} UNICODE_STRING, *PUNICODE_STRING;
#include "commons/Exception.h"
#define DLL_PROCESS_DETACH 0
View
2  xbmc/cores/DllLoader/LibraryLoader.h
@@ -50,6 +50,8 @@ class LibraryLoader
int GetRef();
private:
+ LibraryLoader(const LibraryLoader&);
+ LibraryLoader& operator=(const LibraryLoader&);
char* m_sFileName;
char* m_sPath;
int m_iRefCount;
View
1  xbmc/cores/DllLoader/Win32DllLoader.cpp
@@ -392,7 +392,6 @@ bool FunctionNeedsWrapping(Export *exports, const char *functionName, void **fix
bool Win32DllLoader::ResolveImport(const char *dllName, const char *functionName, void **fixup)
{
- char *dll = GetName();
return FunctionNeedsWrapping(win32_exports, functionName, fixup);
}
View
3  xbmc/cores/DllLoader/coff.cpp
@@ -69,6 +69,7 @@ CoffLoader::CoffLoader()
NumOfDirectories = 0;
NumOfSections = 0;
FileHeaderOffset = 0;
+ EntryAddress = 0;
hModule = NULL;
}
@@ -486,7 +487,6 @@ char *CoffLoader::GetStringTblOff(int Offset)
char *CoffLoader::GetSymbolName(SymbolTable_t *sym)
{
- static char shortname[9];
__int64 index = sym->Name.Offset;
int low = (int)(index & 0xFFFFFFFF);
int high = (int)((index >> 32) & 0xFFFFFFFF);
@@ -497,6 +497,7 @@ char *CoffLoader::GetSymbolName(SymbolTable_t *sym)
}
else
{
+ static char shortname[9];
memset(shortname, 0, 9);
strncpy(shortname, (char *)sym->Name.ShortName, 8);
return shortname;
View
8 xbmc/cores/DllLoader/coffldr.h
@@ -78,10 +78,10 @@ class CoffLoader
int FileHeaderOffset;
// Members for printing the structures
- void PrintFileHeader(COFF_FileHeader_t *FileHeader);
- void PrintWindowsHeader(WindowsHeader_t *WinHdr);
- void PrintOptionHeader(OptionHeader_t *OptHdr);
- void PrintSection(SectionHeader_t *ScnHdr, char *data);
+ static void PrintFileHeader(COFF_FileHeader_t *FileHeader);
+ static void PrintWindowsHeader(WindowsHeader_t *WinHdr);
+ static void PrintOptionHeader(OptionHeader_t *OptHdr);
+ static void PrintSection(SectionHeader_t *ScnHdr, char *data);
void PrintStringTable(void);
void PrintSymbolTable(void);
View
4 xbmc/cores/DllLoader/dll_tracker.cpp
@@ -65,14 +65,14 @@ void tracker_dll_free(DllLoader* pDll)
}
// free all functions which where created at the time we loaded the dll
DummyListIter dit = (*it)->dummyList.begin();
- while (dit != (*it)->dummyList.end()) { free((void*)*dit); dit++; }
+ while (dit != (*it)->dummyList.end()) { free((void*)*dit); ++dit; }
(*it)->dummyList.clear();
delete (*it);
it = g_trackedDlls.erase(it);
}
else
- it++;
+ ++it;
}
}
View
7 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
@@ -218,13 +218,6 @@ extern "C" DWORD WINAPI dllGetFileAttributesA(LPCSTR lpFileName)
#endif
}
-struct SThreadWrapper
-{
- LPTHREAD_START_ROUTINE lpStartAddress;
- LPVOID lpParameter;
- PCHAR lpDLL;
-};
-
extern "C" void WINAPI dllSleep(DWORD dwTime)
{
return ::Sleep(dwTime);
View
6 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -104,12 +104,6 @@ bool bVecDirsInited = false;
extern void update_cache_dialog(const char* tmp);
#endif
-struct _env
-{
- const char* name;
- char* value;
-};
-
#define EMU_MAX_ENVIRONMENT_ITEMS 100
static char *dll__environ_imp[EMU_MAX_ENVIRONMENT_ITEMS + 1];
extern "C" char **dll__environ;
View
1  xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
@@ -76,7 +76,6 @@ class CEmuFileWrapper
private:
EmuFileObject m_files[MAX_EMULATED_FILES];
CCriticalSection m_criticalSection;
- bool m_initialized;
};
extern CEmuFileWrapper g_emuFileWrapper;
View
1  xbmc/cores/DllLoader/ldt_keeper.c
@@ -100,7 +100,6 @@ struct modify_ldt_ldt_s {
unsigned int read_exec_only:1;
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
- unsigned int useable:1;
};
#define MODIFY_LDT_CONTENTS_DATA 0
View
4 xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
@@ -86,6 +86,10 @@ CExternalPlayer::CExternalPlayer(IPlayerCallback& callback)
m_playOneStackItem = false;
m_dialog = NULL;
+ m_hwndXbmc = NULL;
+ m_xPos = 0;
+ m_yPos = 0;
+
#if defined(_WIN32)
memset(&m_processInfo, 0, sizeof(m_processInfo));
View
4 xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -672,12 +672,10 @@ void CBaseRenderer::SetViewMode(int viewMode)
// calculate the desired output ratio
float outputFrameRatio = sourceFrameRatio * g_settings.m_fPixelRatio / CDisplaySettings::Get().GetResolutionInfo(res).fPixelRatio;
// now calculate the correct zoom amount. First zoom to full width.
- float newWidth = screenWidth;
- float newHeight = newWidth / outputFrameRatio;
+ float newHeight = screenWidth / outputFrameRatio;
if (newHeight > screenHeight)
{ // zoom to full height
newHeight = screenHeight;
- newWidth = newHeight * outputFrameRatio;
}
// now work out the zoom amount so that no zoom is done
g_settings.m_fZoomAmount = (m_sourceHeight - CMediaSettings::Get().GetCurrentVideoSettings().m_CropTop - CMediaSettings::Get().GetCurrentVideoSettings().m_CropBottom) / newHeight;
View
2  xbmc/cores/VideoRenderers/BaseRenderer.h
@@ -97,7 +97,7 @@ class CBaseRenderer
bool FindResolutionFromOverride(float fps, float& weight, bool fallback);
void FindResolutionFromFpsMatch(float fps, float& weight);
RESOLUTION FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight);
- float RefreshWeight(float refresh, float fps);
+ static float RefreshWeight(float refresh, float fps);
void CalcNormalDisplayRect(float offsetX, float offsetY, float screenWidth, float screenHeight, float inputFrameRatio, float zoomAmount, float verticalShift);
void CalculateFrameAspectRatio(unsigned int desired_width, unsigned int desired_height);
void ManageDisplay();
View
25 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
@@ -175,6 +175,19 @@ CLinuxRendererGL::CLinuxRendererGL()
m_rgbBufferSize = 0;
m_context = NULL;
m_rgbPbo = 0;
+ m_fbo.width = 0.0;
+ m_fbo.height = 0.0;
+ m_NumYV12Buffers = 0;
+ m_iLastRenderBuffer = 0;
+ m_bConfigured = false;
+ m_bValidated = false;
+ m_bImageReady = false;
+ m_clearColour = 0.0f;
+ m_pboSupported = false;
+ m_pboUsed = false;
+ m_nonLinStretch = false;
+ m_nonLinStretchGui = false;
+ m_pixelRatio = 0.0f;
m_dllSwScale = new DllSwScale;
}
@@ -1006,14 +1019,14 @@ void CLinuxRendererGL::LoadShaders(int field)
UpdateVideoFilter();
break;
}
- else
+ else if (m_pYUVShader)
{
m_pYUVShader->Free();
delete m_pYUVShader;
m_pYUVShader = NULL;
- CLog::Log(LOGERROR, "GL: Error enabling YUV2RGB GLSL shader");
- // drop through and try ARB
}
+ CLog::Log(LOGERROR, "GL: Error enabling YUV2RGB GLSL shader");
+ // drop through and try ARB
}
case RENDER_METHOD_ARB:
// Try ARB shaders if supported and user requested it or GLSL shaders failed.
@@ -1032,14 +1045,14 @@ void CLinuxRendererGL::LoadShaders(int field)
UpdateVideoFilter();
break;
}
- else
+ else if (m_pYUVShader)
{
m_pYUVShader->Free();
delete m_pYUVShader;
m_pYUVShader = NULL;
- CLog::Log(LOGERROR, "GL: Error enabling YUV2RGB ARB shader");
- // drop through and use SW
}
+ CLog::Log(LOGERROR, "GL: Error enabling YUV2RGB ARB shader");
+ // drop through and use SW
}
case RENDER_METHOD_SOFTWARE:
default:
View
35 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -115,6 +115,13 @@ CLinuxRendererGLES::CLinuxRendererGLES()
m_dllSwScale = new DllSwScale;
m_sw_context = NULL;
+ m_NumYV12Buffers = 0;
+ m_iLastRenderBuffer = 0;
+ m_bConfigured = false;
+ m_bValidated = false;
+ m_bImageReady = false;
+ m_StrictBinding = false;
+ m_clearColour = 0.0f;
}
CLinuxRendererGLES::~CLinuxRendererGLES()
@@ -667,7 +674,7 @@ void CLinuxRendererGLES::LoadShaders(int field)
UpdateVideoFilter();
break;
}
- else
+ else if (m_pYUVShader)
{
m_pYUVShader->Free();
delete m_pYUVShader;
@@ -1017,16 +1024,16 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field)
CLog::Log(LOGERROR, "GL: Error enabling YUV shader");
}
- float imgwidth = planes[0].rect.x2 - planes[0].rect.x1;
- float imgheight = planes[0].rect.y2 - planes[0].rect.y1;
- if (m_textureTarget == GL_TEXTURE_2D)
- {
- imgwidth *= planes[0].texwidth;
- imgheight *= planes[0].texheight;
- }
-
- // 1st Pass to video frame size
+// 1st Pass to video frame size
//TODO
+// float imgwidth = planes[0].rect.x2 - planes[0].rect.x1;
+// float imgheight = planes[0].rect.y2 - planes[0].rect.y1;
+// if (m_textureTarget == GL_TEXTURE_2D)
+// {
+// imgwidth *= planes[0].texwidth;
+// imgheight *= planes[0].texheight;
+// }
+//
// glBegin(GL_QUADS);
//
// glMultiTexCoord2fARB(GL_TEXTURE0, planes[0].rect.x1, planes[0].rect.y1);
@@ -1094,10 +1101,10 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field)
VerifyGLState();
- imgwidth /= m_sourceWidth;
- imgheight /= m_sourceHeight;
-
//TODO
+// imgwidth /= m_sourceWidth;
+// imgheight /= m_sourceHeight;
+//
// glBegin(GL_QUADS);
//
// glMultiTexCoord2fARB(GL_TEXTURE0, 0.0f , 0.0f);
@@ -1965,7 +1972,7 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod()
// Player controls render, let it pick the auto-deinterlace method
if((m_renderMethod & RENDER_BYPASS))
{
- if (m_deinterlaceMethods.size())
+ if (!m_deinterlaceMethods.empty())
return ((EINTERLACEMETHOD)m_deinterlaceMethods[0]);
else
return VS_INTERLACEMETHOD_NONE;
View
6 xbmc/cores/VideoRenderers/OverlayRenderer.cpp
@@ -130,7 +130,7 @@ void CRenderer::Release(SElementV& list)
SElementV l = list;
list.clear();
- for(SElementV::iterator it = l.begin(); it != l.end(); it++)
+ for(SElementV::iterator it = l.begin(); it != l.end(); ++it)
{
if(it->overlay)
it->overlay->Release();
@@ -144,7 +144,7 @@ void CRenderer::Release(COverlayV& list)
COverlayV l = list;
list.clear();
- for(COverlayV::iterator it = l.begin(); it != l.end(); it++)
+ for(COverlayV::iterator it = l.begin(); it != l.end(); ++it)
(*it)->Release();
}
@@ -175,7 +175,7 @@ void CRenderer::Render()
Release(m_cleanup);
SElementV& list = m_buffers[m_render];
- for(SElementV::iterator it = list.begin(); it != list.end(); it++)
+ for(SElementV::iterator it = list.begin(); it != list.end(); ++it)
{
COverlay* o = NULL;
View
1  xbmc/cores/VideoRenderers/OverlayRenderer.h
@@ -107,6 +107,7 @@ namespace OVERLAY {
{
overlay_dvd = NULL;
overlay = NULL;
+ pts = 0.0;
}
double pts;
CDVDOverlay* overlay_dvd;
View
14 xbmc/cores/VideoRenderers/RenderManager.cpp
@@ -65,7 +65,8 @@ class CRetakeLock
{
public:
CRetakeLock(CSharedSection &section, bool immidiate = true, CCriticalSection &owned = g_graphicsContext)
- : m_owned(owned)
+ : m_lock (NULL ),
+ m_owned(owned )
{
m_count = m_owned.exit();
m_lock = new T(section);
@@ -104,6 +105,10 @@ CXBMCRenderManager::CXBMCRenderManager()
m_bReconfigured = false;
m_hasCaptures = false;
m_displayLatency = 0.0f;
+ m_presentcorr = 0.0;
+ m_presenterr = 0.0;
+ memset(&m_errorbuff, 0, ERRORBUFFSIZE);
+ m_errorindex = 0;
}
CXBMCRenderManager::~CXBMCRenderManager()
@@ -496,7 +501,7 @@ void CXBMCRenderManager::ManageCaptures()
if (capture->IsAsync() && !(capture->GetFlags() & CAPTUREFLAG_IMMEDIATELY))
RenderCapture(capture);
- it++;
+ ++it;
}
else
{
@@ -505,7 +510,7 @@ void CXBMCRenderManager::ManageCaptures()
}
else
{
- it++;
+ ++it;
}
}
@@ -568,8 +573,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L
EDEINTERLACEMODE deinterlacemode = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode;
EINTERLACEMETHOD interlacemethod = AutoInterlaceMethodInternal(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod);
- bool invert = false;
-
if (deinterlacemode == VS_DEINTERLACEMODE_OFF)
m_presentmethod = PRESENT_METHOD_SINGLE;
else
@@ -578,6 +581,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L
m_presentmethod = PRESENT_METHOD_SINGLE;
else
{
+ bool invert = false;
if (interlacemethod == VS_INTERLACEMETHOD_RENDER_BLEND) m_presentmethod = PRESENT_METHOD_BLEND;
else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE) m_presentmethod = PRESENT_METHOD_WEAVE;
else if (interlacemethod == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED) { m_presentmethod = PRESENT_METHOD_WEAVE ; invert = true; }
View
9 xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h
@@ -36,7 +36,8 @@ class CConvolutionKernel
uint8_t* GetUint8Pixels() { return m_uint8pixels; }
private:
-
+ CConvolutionKernel(const CConvolutionKernel&);
+ CConvolutionKernel& operator=(const CConvolutionKernel&);
void Lanczos2();
void Lanczos3Fast();
void Lanczos3();
@@ -44,9 +45,9 @@ class CConvolutionKernel
void Spline36();
void Bicubic(double B, double C);
- double LanczosWeight(double x, double radius);
- double Spline36Weight(double x);
- double BicubicWeight(double x, double B, double C);
+ static double LanczosWeight(double x, double radius);
+ static double Spline36Weight(double x);
+ static double BicubicWeight(double x, double B, double C);
void ToIntFract();
void ToUint8();
View
8 xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
@@ -32,7 +32,11 @@
CYUV2RGBMatrix::CYUV2RGBMatrix()
{
- m_NeedRecalc = true;
+ m_NeedRecalc = true;
+ m_blacklevel = 0.0f;
+ m_contrast = 0.0f;
+ m_flags = 0;
+ m_format = RENDER_FMT_NONE;
}
void CYUV2RGBMatrix::SetParameters(float contrast, float blacklevel, unsigned int flags, ERenderFormat format)
@@ -159,7 +163,7 @@ bool CWinShader::Execute(std::vector<LPDIRECT3DSURFACE9> *vecRT, unsigned int ve
LPDIRECT3DSURFACE9 oldRT = 0;
// The render target will be overriden: save the caller's original RT
- if (vecRT != NULL && vecRT->size() > 0)
+ if (vecRT != NULL && !vecRT->empty())
pD3DDevice->GetRenderTarget(0, &oldRT);
pD3DDevice->SetFVF(m_FVF);
View
15 xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.h
@@ -46,7 +46,12 @@ class CYUV2RGBMatrix
class CWinShader
{
protected:
- CWinShader() {}
+ CWinShader() :
+ m_vbsize(0),
+ m_FVF(0),
+ m_vertsize(0),
+ m_primitivesCount(0)
+ {}
virtual ~CWinShader();
virtual bool CreateVertexBuffer(DWORD FVF, unsigned int vertCount, unsigned int vertSize, unsigned int primitivesCount);
virtual bool LockVertexBuffer(void **data);
@@ -74,6 +79,13 @@ class CYUV2RGBShader : public CWinShader
float brightness,
unsigned int flags,
YUVBuffer* YUVbuf);
+ CYUV2RGBShader() :
+ m_sourceWidth (0),
+ m_sourceHeight(0),
+ m_format (RENDER_FMT_NONE)
+ {
+ memset(&m_texSteps,0,sizeof(m_texSteps));
+ }
virtual ~CYUV2RGBShader();
protected:
@@ -138,6 +150,7 @@ class CConvolutionShader1Pass : public CConvolutionShader
unsigned int destWidth, unsigned int destHeight,
CRect sourceRect,
CRect destRect);
+ CConvolutionShader1Pass() : m_sourceWidth (0), m_sourceHeight(0) {}
protected:
virtual void PrepareParameters(unsigned int sourceWidth, unsigned int sourceHeight,
View
79 xbmc/cores/VideoRenderers/WinRenderer.cpp
@@ -85,6 +85,13 @@ CWinRenderer::CWinRenderer()
m_sw_scale_ctx = NULL;
m_dllSwScale = NULL;
+ m_destWidth = 0;
+ m_destHeight = 0;
+ m_dllAvUtil = NULL;
+ m_dllAvCodec = NULL;
+ m_bConfigured = false;
+ m_clearColour = 0;
+ m_format = RENDER_FMT_NONE;
}
CWinRenderer::~CWinRenderer()
@@ -512,7 +519,7 @@ void CWinRenderer::SelectPSVideoFilter()
bool scaleUp = (int)m_sourceHeight < g_graphicsContext.GetHeight() && (int)m_sourceWidth < g_graphicsContext.GetWidth();
bool scaleFps = m_fps < (g_advancedSettings.m_videoAutoScaleMaxFps + 0.01f);
- if (Supports(VS_SCALINGMETHOD_LANCZOS3_FAST) && scaleSD && scaleUp && scaleFps)
+ if (scaleSD && scaleUp && scaleFps && Supports(VS_SCALINGMETHOD_LANCZOS3_FAST))
{
m_scalingMethod = VS_SCALINGMETHOD_LANCZOS3_FAST;
m_bUseHQScaler = true;
@@ -798,46 +805,46 @@ void CWinRenderer::ScaleFixedPipeline()
if (!cbcontrol)
{
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
}
else
{
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE2X );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
- hr = pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE );
-
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_ADDSIGNED );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_CURRENT );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_SPECULAR );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
- hr = pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAARG1, D3DTA_CURRENT );
-
- hr = pD3DDev->SetTextureStageState( 2, D3DTSS_COLOROP, D3DTOP_DISABLE );
- hr = pD3DDev->SetTextureStageState( 2, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE2X );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
+ pD3DDev->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE );
+
+ pD3DDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_ADDSIGNED );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_CURRENT );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_SPECULAR );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
+ pD3DDev->SetTextureStageState( 1, D3DTSS_ALPHAARG1, D3DTA_CURRENT );
+
+ pD3DDev->SetTextureStageState( 2, D3DTSS_COLOROP, D3DTOP_DISABLE );
+ pD3DDev->SetTextureStageState( 2, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
}
- hr = pD3DDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
- hr = pD3DDev->SetRenderState(D3DRS_LIGHTING, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_ZENABLE, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_STENCILENABLE, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
- hr = pD3DDev->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA|D3DCOLORWRITEENABLE_BLUE|D3DCOLORWRITEENABLE_GREEN|D3DCOLORWRITEENABLE_RED);
-
- hr = pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, m_TextureFilter);
- hr = pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, m_TextureFilter);
- hr = pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
- hr = pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
-
- hr = pD3DDev->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1);
+ pD3DDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
+ pD3DDev->SetRenderState(D3DRS_LIGHTING, FALSE);
+ pD3DDev->SetRenderState(D3DRS_ZENABLE, FALSE);
+ pD3DDev->SetRenderState(D3DRS_STENCILENABLE, FALSE);
+ pD3DDev->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
+ pD3DDev->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
+ pD3DDev->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
+ pD3DDev->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA|D3DCOLORWRITEENABLE_BLUE|D3DCOLORWRITEENABLE_GREEN|D3DCOLORWRITEENABLE_RED);
+
+ pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, m_TextureFilter);
+ pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, m_TextureFilter);
+ pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
+ pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
+
+ pD3DDev->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1);
if (FAILED(hr = pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertex, sizeof(VERTEX))))
CLog::Log(LOGERROR, __FUNCTION__": DrawPrimitiveUP failed. %s", CRenderSystemDX::GetErrorDescription(hr).c_str());
View
1  xbmc/cores/VideoRenderers/WinRenderer.h
@@ -112,6 +112,7 @@ struct SVideoPlane
struct YUVBuffer : SVideoBuffer
{
+ YUVBuffer() : m_width (0), m_height(0), m_format(RENDER_FMT_NONE), m_activeplanes(0) {}
~YUVBuffer();
bool Create(ERenderFormat format, unsigned int width, unsigned int height);
virtual void Release();
View
2  xbmc/cores/VideoRenderers/legacy/ComboRenderer.cpp
@@ -34,6 +34,8 @@ CComboRenderer::CComboRenderer(LPDIRECT3DDEVICE8 pDevice)
m_hPixelShader = 0;
m_iYUY2RenderBuffer = 0;
m_iYUY2Buffers = 2;
+ m_iScreenWidth = 0;
+ m_iScreenHeight = 0;
}
void CComboRenderer::DeleteYUY2Texture(int index)
View
2  xbmc/cores/VideoRenderers/legacy/RGBRendererV2.cpp
@@ -37,6 +37,8 @@ CRGBRendererV2::CRGBRendererV2(LPDIRECT3DDEVICE8 pDevice)
m_UVLookup = NULL;
m_UVErrorLookup = NULL;
m_motionpass = 5;
+ m_444GeneratedFull = false;
+ m_444RenderBuffer = 0;
memset(&m_yuvcoef_last, 0, sizeof(YUVCOEF));
memset(&m_yuvrange_last, 0, sizeof(YUVRANGE));
}
View
60 xbmc/cores/amlplayer/AMLPlayer.cpp
@@ -316,7 +316,7 @@ CAMLSubTitleThread::~CAMLSubTitleThread()
void CAMLSubTitleThread::UpdateSubtitle(CStdString &subtitle, int64_t elapsed_ms)
{
CSingleLock lock(m_subtitle_csection);
- if (m_subtitle_strings.size())
+ if (!m_subtitle_strings.empty())
{
AMLSubtitle *amlsubtitle;
// remove any expired subtitles
@@ -327,7 +327,7 @@ void CAMLSubTitleThread::UpdateSubtitle(CStdString &subtitle, int64_t elapsed_ms
if (elapsed_ms > amlsubtitle->endtime)
it = m_subtitle_strings.erase(it);
else
- it++;
+ ++it;
}
// find the current subtitle
@@ -340,7 +340,7 @@ void CAMLSubTitleThread::UpdateSubtitle(CStdString &subtitle, int64_t elapsed_ms
subtitle = amlsubtitle->string;
break;
}
- it++;
+ ++it;
}
}
}
@@ -364,7 +364,6 @@ void CAMLSubTitleThread::Process(void)
int sub_size = m_dll->codec_get_sub_size_fd(m_subtitle_codec);
if (sub_size > 0)
{
- int sub_type = 0, sub_pts = 0;
// calloc sub_size + 1 so we auto terminate the string
char *sub_buffer = (char*)calloc(sub_size + 1, 1);
m_dll->codec_read_sub_data_fd(m_subtitle_codec, sub_buffer, sub_size);
@@ -381,10 +380,9 @@ void CAMLSubTitleThread::Process(void)
CSingleLock lock(m_subtitle_csection);
AMLSubtitle *subtitle = new AMLSubtitle;
-
- sub_type = (sub_buffer[5] << 16) | (sub_buffer[6] << 8) | sub_buffer[7];
+ int sub_type = (sub_buffer[5] << 16) | (sub_buffer[6] << 8) | sub_buffer[7];
// sub_pts are in ffmpeg timebase, not ms timebase, convert it.
- sub_pts = (sub_buffer[12] << 24) | (sub_buffer[13] << 16) | (sub_buffer[14] << 8) | sub_buffer[15];
+ int sub_pts = (sub_buffer[12] << 24) | (sub_buffer[13] << 16) | (sub_buffer[14] << 8) | sub_buffer[15];
/* TODO: handle other subtitle codec types
// subtitle codecs
@@ -502,20 +500,46 @@ void CAMLSubTitleThread::Process(void)
////////////////////////////////////////////////////////////////////////////////////////////
CAMLPlayer::CAMLPlayer(IPlayerCallback &callback)
: IPlayer(callback),
- CThread("CAMLPlayer"),
- m_ready(true)
+ CThread ("CAMLPlayer" ),
+ m_cpu (0 ),
+ m_speed (0 ),
+ m_paused (false ),
+ m_bAbortRequest (false ),
+ m_ready (true ),
+ m_audio_index (0 ),
+ m_audio_count (0 ),
+ m_audio_delay (0 ),
+ m_audio_passthrough_ac3 (false ),
+ m_audio_passthrough_dts (false ),
+ m_audio_mute (false ),
+ m_audio_volume (0.0f ),
+ m_video_index (0 ),
+ m_video_count (0 ),
+ m_video_width (0 ),
+ m_video_height (0 ),
+ m_video_fps_numerator (0 ),
+ m_video_fps_denominator (0 ),
+ m_subtitle_index (0 ),
+ m_subtitle_count (0 ),
+ m_subtitle_show (false ),
+ m_subtitle_delay (0 ),
+ m_subtitle_thread (NULL ),
+ m_chapter_index (0 ),
+ m_chapter_count (0 ),
+ m_show_mainvideo (0 ),
+ m_view_mode (0 ),
+ m_zoom (0 ),
+ m_contrast (0 ),
+ m_brightness (0 )
{
m_dll = new DllLibAmplayer;
m_dll->Load();
m_pid = -1;
- m_speed = 0;
- m_paused = false;
#if defined(_DEBUG)
m_log_level = 5;
#else
m_log_level = 3;
#endif
- m_bAbortRequest = false;
// for external subtitles
m_dvdOverlayContainer = new CDVDOverlayContainer;
@@ -814,7 +838,7 @@ void CAMLPlayer::SetVolume(float volume)
void CAMLPlayer::GetAudioInfo(CStdString &strAudioInfo)
{
CSingleLock lock(m_aml_csection);
- if (m_audio_streams.size() == 0 || m_audio_index > (int)(m_audio_streams.size() - 1))
+ if (m_audio_streams.empty() || m_audio_index > (int)(m_audio_streams.size() - 1))
return;
strAudioInfo.Format("Audio stream (%s) [Kb/s:%.2f]",
@@ -825,7 +849,7 @@ void CAMLPlayer::GetAudioInfo(CStdString &strAudioInfo)
void CAMLPlayer::GetVideoInfo(CStdString &strVideoInfo)
{
CSingleLock lock(m_aml_csection);
- if (m_video_streams.size() == 0 || m_video_index > (int)(m_video_streams.size() - 1))
+ if (m_video_streams.empty() || m_video_index > (int)(m_video_streams.size() - 1))
return;
strVideoInfo.Format("Video stream (%s) [fr:%.3f Mb/s:%.2f]",
@@ -1085,7 +1109,7 @@ __int64 CAMLPlayer::GetTotalTime()
void CAMLPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info)
{
CSingleLock lock(m_aml_csection);
- if (index < 0 || m_audio_streams.size() == 0 || index > (int)(m_audio_streams.size() - 1))
+ if (index < 0 || m_audio_streams.empty() || index > (int)(m_audio_streams.size() - 1))
return;
info.bitrate = m_audio_streams[index]->bit_rate;
@@ -1126,7 +1150,7 @@ void CAMLPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info)
void CAMLPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info)
{
CSingleLock lock(m_aml_csection);
- if (m_video_streams.size() == 0 || m_video_index > (int)(m_video_streams.size() - 1))
+ if (m_video_streams.empty() || m_video_index > (int)(m_video_streams.size() - 1))
return;
info.bitrate = m_video_streams[m_video_index]->bit_rate;
@@ -1150,7 +1174,7 @@ int CAMLPlayer::GetBitsPerSample()
int CAMLPlayer::GetSampleRate()
{
CSingleLock lock(m_aml_csection);
- if (m_audio_streams.size() == 0 || m_audio_index > (int)(m_audio_streams.size() - 1))
+ if (m_audio_streams.empty() || m_audio_index > (int)(m_audio_streams.size() - 1))
return 0;
return m_audio_streams[m_audio_index]->sample_rate;
@@ -2103,11 +2127,11 @@ void CAMLPlayer::FindSubtitleFiles()
int CAMLPlayer::AddSubtitleFile(const std::string &filename, const std::string &subfilename)
{
std::string ext = URIUtils::GetExtension(filename);
- std::string vobsubfile = subfilename;
if(ext == ".idx")
{
/* TODO: we do not handle idx/sub binary subs yet.
+ std::string vobsubfile = subfilename;
if (vobsubfile.empty())
vobsubfile = URIUtils::ReplaceExtension(filename, ".sub");
View
2  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp
@@ -47,12 +47,12 @@ int CDVDAudioCodecLPcm::Decode(BYTE* pData, int iSize)
{
BYTE* d = m_buffer;
BYTE* s = pData;
- int iDecoded = 0;
if (iSize > m_bufferSize) iSize = m_bufferSize;
if (iSize >= 12)
{
+ int iDecoded = 0;
#if 0
if (m_codecID == CODEC_ID_LPCM_S24BE)
#endif
View
4 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.cpp
@@ -36,6 +36,8 @@ CDVDAudioCodecLibMad::CDVDAudioCodecLibMad() : CDVDAudioCodec()
m_iSourceBitrate = 0;
m_iInputBufferSize = 0;
+ memset(&m_decodedData, 0, MAD_DECODED_SIZE);
+ memset(&m_inputBuffer, 0, MAD_INPUT_SIZE);
}
CDVDAudioCodecLibMad::~CDVDAudioCodecLibMad()
@@ -86,7 +88,6 @@ int CDVDAudioCodecLibMad::Decode(BYTE* pData, int iSize)
{
BYTE* pBuffer = m_inputBuffer;
//int iBufferSize = iSize;
- bool bFullOutputBuffer = false;
m_iDecodedDataSize = 0;
@@ -100,6 +101,7 @@ int CDVDAudioCodecLibMad::Decode(BYTE* pData, int iSize)
if (m_bInitialized)
{
+ bool bFullOutputBuffer = false;
m_dll.mad_stream_buffer(&m_stream, pBuffer, m_iInputBufferSize);
while (true)
View
5 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
@@ -60,6 +60,11 @@ CDVDAudioCodecPassthroughFFmpeg::CDVDAudioCodecPassthroughFFmpeg(void)
/* make enough room for at-least two audio frames */
m_DecodeSize = 0;
m_DecodeBuffer = NULL;
+ m_bSupportsAC3Out = false;
+ m_bSupportsDTSOut = false;
+ m_bSupportsAACOut = false;
+ m_LostSync = false;
+
}
CDVDAudioCodecPassthroughFFmpeg::~CDVDAudioCodecPassthroughFFmpeg(void)
View
2  xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
@@ -61,7 +61,7 @@ extern "C" {
class CDVDCodecOption
{
public:
- CDVDCodecOption(std::string name, std::string value) { m_name = name; m_value = value; }
+ CDVDCodecOption(const std::string& name, const std::string& value) : m_name(name), m_value(value) {}
std::string m_name;
std::string m_value;
};
View
2  xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -128,7 +128,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
CDVDVideoCodec* pCodec = NULL;
CDVDCodecOptions options;
- if(formats.size() == 0)
+ if(formats.empty())
options.m_formats.push_back(RENDER_FMT_YUV420P);
else
options.m_formats = formats;
View
12 xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h
@@ -75,8 +75,8 @@ class CDVDOverlay
}
/**
- * decrease the reference counter by one.
- */
+ * increase the reference counter by one.
+ */
CDVDOverlay* Acquire()
{
AtomicIncrement(&m_references);
@@ -84,8 +84,8 @@ class CDVDOverlay
}
/**
- * increase the reference counter by one.
- */
+ * decrease the reference counter by one.
+ */
long Release()
{
long count = AtomicDecrement(&m_references);
@@ -145,8 +145,8 @@ class CDVDOverlayGroup : public CDVDOverlay
CDVDOverlayGroup(CDVDOverlayGroup& src)
: CDVDOverlay(src)
{
- for(VecOverlaysIter it = m_overlays.begin(); it != m_overlays.end(); ++it)
- m_overlays.push_back((*it)->Acquire());
+ for(VecOverlaysIter it = src.m_overlays.begin(); it != src.m_overlays.end(); ++it)
+ m_overlays.push_back((*it)->Clone());
}
VecOverlays m_overlays;
};
View
5 xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodec.h
@@ -39,10 +39,7 @@ class CDVDOverlayCodec
{
public:
- CDVDOverlayCodec(const char* name)
- {
- m_codecName = name;
- }
+ CDVDOverlayCodec(const char* name) : m_codecName(name) {}
virtual ~CDVDOverlayCodec() {}
View
12 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
@@ -1869,9 +1869,17 @@ bool CCrystalHD::bitstream_convert_init(void *in_extradata, int in_extrasize)
free(out);
return false;
}
- out = (uint8_t*)realloc(out, total_size);
- if (!out)
+ uint8_t* new_out = (uint8_t*)realloc(out, total_size);
+ if (new_out)
+ {
+ out = new_out;
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "bitstream_convert_init failed - %s : could not realloc the buffer out", __FUNCTION__);
+ free(out);
return false;
+ }
memcpy(out + total_size - unit_size - 4, nalu_header, 4);
memcpy(out + total_size - unit_size, extradata + 2, unit_size);
View
2  xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.h
@@ -44,7 +44,7 @@ class CSyncPtrQueue
{
T* p = NULL;
CSingleLock lock(m_Lock);
- if (m_Queue.size())
+ if (!m_Queue.empty())
{
p = m_Queue.front();
m_Queue.pop_front();
View
4 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -294,7 +294,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
}
// set any special options
- for(std::vector<CDVDCodecOption>::iterator it = options.m_keys.begin(); it != options.m_keys.end(); it++)
+ for(std::vector<CDVDCodecOption>::iterator it = options.m_keys.begin(); it != options.m_keys.end(); ++it)
{
if (it->m_name == "surfaces")
m_uSurfacesCount = std::atoi(it->m_value.c_str());
@@ -839,7 +839,7 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
{
result = m_dllAvFilter.av_buffersink_get_buffer_ref(m_pFilterOut, &m_pBufferRef, 0);
- if(!m_pBufferRef)
+ if(!m_pBufferRef || result < 0)
{
CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - cur_buf");
return VC_ERROR;
View
2  xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h
@@ -43,7 +43,7 @@ class CDVDVideoCodecLibMpeg2 : public CDVDVideoCodec
inline void ReleaseBuffer(DVDVideoPicture* pPic);
inline void DeleteBuffer(DVDVideoPicture* pPic);
- int GuessAspect(const mpeg2_sequence_t *sequence, unsigned int *pixel_width, unsigned int *pixel_height);
+ static int GuessAspect(const mpeg2_sequence_t *sequence, unsigned int *pixel_width, unsigned int *pixel_height);
mpeg2dec_t* m_pHandle;
const mpeg2_info_t* m_pInfo;
View
14 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp
@@ -98,8 +98,6 @@ bool CDVDVideoCodecOpenMax::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
// allocate a YV12 DVDVideoPicture buffer.
// first make sure all properties are reset.
memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
- unsigned int luma_pixels = hints.width * hints.height;
- unsigned int chroma_pixels = luma_pixels/4;
m_videobuffer.dts = DVD_NOPTS_VALUE;
m_videobuffer.pts = DVD_NOPTS_VALUE;
@@ -235,9 +233,17 @@ bool CDVDVideoCodecOpenMax::bitstream_convert_init(void *in_extradata, int in_ex
free(out);
return false;
}
- out = (uint8_t*)realloc(out, total_size);
- if (!out)
+ uint8_t* new_out = (uint8_t*)realloc(out, total_size);
+ if (new_out)
+ {
+ out = new_out;
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "bitstream_convert_init failed - %s : could not realloc the buffer out", __FUNCTION__);
+ free(out);
return false;
+ }
memcpy(out + total_size - unit_size - 4, nalu_header, 4);
memcpy(out + total_size - unit_size, extradata + 2, unit_size);
View
11 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h
@@ -47,7 +47,7 @@ class CDVDVideoCodecOpenMax : public CDVDVideoCodec
// bitstream to bytestream (Annex B) conversion support.
bool bitstream_convert_init(void *in_extradata, int in_extrasize);
bool bitstream_convert(BYTE* pData, int iSize, uint8_t **poutbuf, int *poutbuf_size);
- void bitstream_alloc_and_copy( uint8_t **poutbuf, int *poutbuf_size,
+ static void bitstream_alloc_and_copy( uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *sps_pps, uint32_t sps_pps_size, const uint8_t *in, uint32_t in_size);
typedef struct omx_bitstream_ctx {
@@ -55,6 +55,15 @@ class CDVDVideoCodecOpenMax : public CDVDVideoCodec
uint8_t first_idr;
uint8_t *sps_pps_data;
uint32_t size;
+
+ omx_bitstream_ctx()
+ {
+ length_size = 0;
+ first_idr = 0;
+ sps_pps_data = NULL;
+ size = 0;
+ }
+
} omx_bitstream_ctx;
uint32_t m_sps_pps_size;
View
5 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
@@ -208,6 +208,11 @@ CDVDVideoCodecVDA::CDVDVideoCodecVDA() : CDVDVideoCodec()
m_bitstream = NULL;
m_dllSwScale = NULL;
memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
+ m_dll = NULL;
+ m_DropPictures = false;
+ m_decode_async = false;
+ m_sort_time_offset = 0.0;
+ m_use_cvBufferRef = false;
}
CDVDVideoCodecVDA::~CDVDVideoCodecVDA()
View
4 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
@@ -1046,6 +1046,8 @@ CDVDVideoCodecVideoToolBox::CDVDVideoCodecVideoToolBox() : CDVDVideoCodec()
m_dllAvUtil = NULL;
m_dllAvFormat = NULL;
memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
+ m_DropPictures = false;
+ m_sort_time_offset = 0.0;
}
CDVDVideoCodecVideoToolBox::~CDVDVideoCodecVideoToolBox()
@@ -1349,7 +1351,7 @@ int CDVDVideoCodecVideoToolBox::Decode(BYTE* pData, int iSize, double dts, doubl
if(m_dllAvFormat->avio_open_dyn_buf(&pb) < 0)
return VC_ERROR;
- demux_size = avc_parse_nal_units(m_dllAvFormat, pb, pData, iSize);
+ avc_parse_nal_units(m_dllAvFormat, pb, pData, iSize);
demux_size = m_dllAvFormat->avio_close_dyn_buf(pb, &demux_buff);
sampleBuff = CreateSampleBufferFrom(m_fmt_desc, demux_buff, demux_size);
}
View
6 xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
@@ -313,7 +313,7 @@ CSurfaceContext::CSurfaceContext()
CSurfaceContext::~CSurfaceContext()
{
- for (vector<IDirect3DSurface9*>::iterator it = m_heldsurfaces.begin(); it != m_heldsurfaces.end(); it++)
+ for (vector<IDirect3DSurface9*>::iterator it = m_heldsurfaces.begin(); it != m_heldsurfaces.end(); ++it)
SAFE_RELEASE(*it);
}
@@ -1490,7 +1490,7 @@ bool CProcessor::Render(CRect src, CRect dst, IDirect3DSurface9* target, REFEREN
it = m_sample.erase(it);
}
else
- it++;
+ ++it;
}
if(m_sample.empty())
@@ -1520,7 +1520,7 @@ bool CProcessor::Render(CRect src, CRect dst, IDirect3DSurface9* target, REFEREN
for (int i = 0; i < count; i++)
samp[i].SampleFormat.SampleFormat = DXVA2_SampleUnknown;
- for(it = m_sample.begin(); it != m_sample.end() && valid < count; it++)
+ for(it = m_sample.begin(); it != m_sample.end() && valid < count; ++it)
{
if (it->sample.Start >= MinTime && it->sample.Start <= MaxTime)
{
View
6 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMax.cpp
@@ -103,6 +103,9 @@ COpenMax::COpenMax()
m_is_open = false;
m_omx_decoder = NULL;
+ m_omx_client_state = DEAD;
+ m_omx_decoder_state = 0;
+ sem_init(m_omx_decoder_state_change, 0, 0);
/*
m_omx_flush_input = (sem_t*)malloc(sizeof(sem_t));
sem_init(m_omx_flush_input, 0, 0);
@@ -167,11 +170,10 @@ OMX_ERRORTYPE COpenMax::DecoderFillBufferDoneCallback(
// Wait for a component to transition to the specified state
OMX_ERRORTYPE COpenMax::WaitForState(OMX_STATETYPE state)
{
- OMX_ERRORTYPE omx_error = OMX_ErrorNone;
OMX_STATETYPE test_state;
int tries = 0;
struct timespec timeout;
- omx_error = OMX_GetState(m_omx_decoder, &test_state);
+ OMX_ERRORTYPE omx_error = OMX_GetState(m_omx_decoder, &test_state);
#if defined(OMX_DEBUG_VERBOSE)
CLog::Log(LOGDEBUG, "%s::%s - waiting for state(%d)\n", CLASSNAME, __func__, state);
View
17 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp
@@ -86,6 +86,15 @@ COpenMaxVideo::COpenMaxVideo()
m_omx_decoder_state_change = (sem_t*)malloc(sizeof(sem_t));
sem_init(m_omx_decoder_state_change, 0, 0);
+ memset(&m_videobuffer, 0, sizeof(DVDVideoPicture));
+ m_drop_state = false;
+ m_decoded_width = 0;
+ m_decoded_height = 0;
+ m_omx_input_eos = false;
+ m_omx_input_port = 0;
+ m_omx_output_eos = false;
+ m_omx_output_port = 0;
+ m_videoplayback_done = false;
}
COpenMaxVideo::~COpenMaxVideo()
@@ -861,7 +870,7 @@ OMX_ERRORTYPE COpenMaxVideo::DecoderEventHandler(
if (ctx->m_omx_output_port == (int)nData2)
{
// Got OMX_CommandPortDisable event, alloc new buffers for the output port.
- omx_err = ctx->AllocOMXOutputBuffers();
+ ctx->AllocOMXOutputBuffers();
omx_err = OMX_SendCommand(ctx->m_omx_decoder, OMX_CommandPortEnable, ctx->m_omx_output_port, NULL);
}
break;
@@ -917,7 +926,7 @@ OMX_ERRORTYPE COpenMaxVideo::DecoderEventHandler(
// OMX_CommandPortDisable to component as it expects output buffers
// to be freed before it will issue a OMX_CommandPortDisable event.
ctx->m_portChanging = true;
- omx_err = OMX_SendCommand(ctx->m_omx_decoder, OMX_CommandPortDisable, ctx->m_omx_output_port, NULL);
+ OMX_SendCommand(ctx->m_omx_decoder, OMX_CommandPortDisable, ctx->m_omx_output_port, NULL);
omx_err = ctx->FreeOMXOutputBuffers(false);
}
break;
@@ -1025,9 +1034,9 @@ OMX_ERRORTYPE COpenMaxVideo::StopDecoder(void)
// we can free our allocated port buffers in OMX_StateIdle state.
// free OpenMax input buffers.
- omx_err = FreeOMXInputBuffers(true);
+ FreeOMXInputBuffers(true);
// free OpenMax output buffers.
- omx_err = FreeOMXOutputBuffers(true);
+ FreeOMXOutputBuffers(true);
// transition decoder component from idle to loaded
omx_err = SetStateForComponent(OMX_StateLoaded);
View
12 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
@@ -161,7 +161,7 @@ void CDecoder::RelBuffer(AVCodecContext *avctx, AVFrame *pic)
{
VASurfaceID surface = GetSurfaceID(pic);
- for(std::list<CSurfacePtr>::iterator it = m_surfaces_used.begin(); it != m_surfaces_used.end(); it++)
+ for(std::list<CSurfacePtr>::iterator it = m_surfaces_used.begin(); it != m_surfaces_used.end(); ++it)
{
if((*it)->m_id == surface)
{
@@ -184,7 +184,7 @@ int CDecoder::GetBuffer(AVCodecContext *avctx, AVFrame *pic)
if(surface)
{
/* reget call */
- for(; it != m_surfaces_free.end(); it++)
+ for(; it != m_surfaces_free.end(); ++it)
{
if((*it)->m_id == surface)
{
@@ -204,7 +204,7 @@ int CDecoder::GetBuffer(AVCodecContext *avctx, AVFrame *pic)
{
// To avoid stutter, we scan the free surface pool (provided by decoder) for surfaces
// that are 100% not in use by renderer. The pointers to these surfaces have a use_count of 1.
- for (; it != m_surfaces_free.end() && it->use_count() > 1; it++) {}
+ for (; it != m_surfaces_free.end() && it->use_count() > 1; ++it) {}
// If we have zero free surface from decoder OR all free surfaces are in use by renderer, we allocate a new surface
if (it == m_surfaces_free.end())
@@ -217,7 +217,7 @@ int CDecoder::GetBuffer(AVCodecContext *avctx, AVFrame *pic)
return -1;
}
// Set itarator position to the newly allocated surface (end-1)
- it = m_surfaces_free.end(); it--;
+ it = m_surfaces_free.end(); --it;
}
/* getbuffer call */
wrapper = it->get();
@@ -452,7 +452,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture
m_holder.surface.reset();
std::list<CSurfacePtr>::iterator it;
- for(it = m_surfaces_used.begin(); it != m_surfaces_used.end() && !m_holder.surface; it++)
+ for(it = m_surfaces_used.begin(); it != m_surfaces_used.end() && !m_holder.surface; ++it)
{
if((*it)->m_id == surface)
{
@@ -461,7 +461,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture
}
}
- for(it = m_surfaces_free.begin(); it != m_surfaces_free.end() && !m_holder.surface; it++)
+ for(it = m_surfaces_free.begin(); it != m_surfaces_free.end() && !m_holder.surface; ++it)
{
if((*it)->m_id == surface)
{
View
30 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -148,6 +148,31 @@ CVDPAU::CVDPAU()
dl_vdp_device_create_x11 = NULL;
dl_vdp_get_proc_address = NULL;
dl_vdp_preemption_callback_register = NULL;
+ past[0] = NULL;
+ past[1] = NULL;
+ current = NULL;
+ future = NULL;
+ tmpNoiseReduction = 0.0f;
+ tmpSharpness = 0.0f;
+ vdp_get_proc_address = NULL;
+ vdp_device_destroy = NULL;
+ vdp_video_surface_create = NULL;
+ vdp_video_surface_destroy = NULL;
+ vdp_video_surface_put_bits_y_cb_cr = NULL;
+ vdp_video_surface_get_bits_y_cb_cr = NULL;
+ vdp_output_surface_put_bits_y_cb_cr = NULL;
+ vdp_output_surface_put_bits_native = NULL;
+ vdp_output_surface_create = NULL;
+ vdp_output_surface_destroy = NULL;
+ vdp_output_surface_get_bits_native = NULL;
+ vdp_output_surface_render_output_surface = NULL;
+ vdp_output_surface_put_bits_indexed = NULL;
+ vdp_video_mixer_create = NULL;
+ vdp_video_mixer_set_feature_enables = NULL;
+ vdp_video_mixer_query_parameter_support = NULL;
+ vdp_video_mixer_query_feature_support = NULL;
+ vdp_video_mixer_destroy = NULL;
+ vdp_video_mixer_render = NULL;
}
bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces)
@@ -502,8 +527,7 @@ void CVDPAU::CheckFeatures()
tmpNoiseReduction = 0;
tmpSharpness = 0;
- VdpStatus vdp_st = VDP_STATUS_ERROR;
- vdp_st = vdp_video_mixer_create(vdp_device,
+ VdpStatus vdp_st = vdp_video_mixer_create(vdp_device,
m_feature_count,
m_features,
ARSIZE(parameters),
@@ -1517,7 +1541,7 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame)
}
}
- vdp_st = vdp_presentation_queue_block_until_surface_idle(vdp_flip_queue,outputSurface,&time);
+ vdp_presentation_queue_block_until_surface_idle(vdp_flip_queue,outputSurface,&time);
VdpRect sourceRect = {0,0,vid_width, vid_height};
View
2  xbmc/cores/dvdplayer/DVDDemuxSPU.cpp
@@ -582,10 +582,10 @@ void CDVDDemuxSPU::FindSubtitleColor(int last_color, int stats[4], CDVDOverlaySp
else
{
// old code
- int i, i_inner = -1, i_shade = -1;
if (last_color >= 0 && last_color < 4)
{
+ int i, i_inner = -1, i_shade = -1;
// Set the border color, the last color is probably the border color
pSPU->color[last_color][0] = custom_subtitle_color[COLOR_BORDER][0];
pSPU->color[last_color][1] = custom_subtitle_color[COLOR_BORDER][1];
View
4 xbmc/cores/dvdplayer/DVDDemuxSPU.h
@@ -46,8 +46,8 @@ class CDVDDemuxSPU
CDVDOverlaySpu* AddData(BYTE* data, int iSize, double pts); // returns a packet from ParsePacket if possible
CDVDOverlaySpu* ParseRLE(CDVDOverlaySpu* pSPU, BYTE* pUnparsedData);
- void FindSubtitleColor(int last_color, int stats[4], CDVDOverlaySpu* pSPU);
- bool CanDisplayWithAlphas(int a[4], int stats[4]);
+ static void FindSubtitleColor(int last_color, int stats[4], CDVDOverlaySpu* pSPU);
+ static bool CanDisplayWithAlphas(int a[4], int stats[4]);
void Reset();
void FlushCurrentPacket(); // flushes current unparsed data
View
2  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxHTSP.cpp
@@ -102,7 +102,7 @@ bool CDVDDemuxHTSP::Open(CDVDInputStream* input)
m_Input = (CDVDInputStreamHTSP*)input;
m_StatusCount = 0;
- while(m_Streams.size() == 0 && m_StatusCount == 0)
+ while(m_Streams.empty() && m_StatusCount == 0)
{
DemuxPacket* pkg = Read();
if(!pkg)
View
1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp
@@ -34,6 +34,7 @@ CDemuxStreamPVRInternal::CDemuxStreamPVRInternal(CDVDDemuxPVRClient *parent)
: m_parent(parent)
, m_parser(NULL)
, m_context(NULL)
+ , m_parser_split(false)
{
}
View
4 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxShoutcast.cpp
@@ -118,8 +118,6 @@ void CDVDDemuxShoutcast::Flush()
DemuxPacket* CDVDDemuxShoutcast::Read()
{
- int iRead = 0;
-
// XXX
// if meta interval is greater than FileCurl's max read size (currently 64k)
// it will simply fail becuse the meta-interval will get incorrect
@@ -152,7 +150,7 @@ DemuxPacket* CDVDDemuxShoutcast::Read()
// we already have read m_iMetaStreamInterval bytes of streaming data
// metadata follows
BYTE l;
- iRead = m_pInput->Read(&l, 1);
+ int iRead = m_pInput->Read(&l, 1);
if (iRead > 0)
{
int iMetaLength = l * 16;
View
8 xbmc/cores/dvdplayer/DVDFileInfo.cpp
@@ -236,13 +236,13 @@ bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, CTextureDetails &deta
BYTE *pOutBuf = new BYTE[nWidth * nHeight * 4];
struct SwsContext *context = dllSwScale.sws_getContext(picture.iWidth, picture.iHeight,
PIX_FMT_YUV420P, nWidth, nHeight, PIX_FMT_BGRA, SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
- uint8_t *src[] = { picture.data[0], picture.data[1], picture.data[2], 0 };
- int srcStride[] = { picture.iLineSize[0], picture.iLineSize[1], picture.iLineSize[2], 0 };
- uint8_t *dst[] = { pOutBuf, 0, 0, 0 };
- int dstStride[] = { (int)nWidth*4, 0, 0, 0 };
if (context)
{
+ uint8_t *src[] = { picture.data[0], picture.data[1], picture.data[2], 0 };
+ int srcStride[] = { picture.iLineSize[0], picture.iLineSize[1], picture.iLineSize[2], 0 };
+ uint8_t *dst[] = { pOutBuf, 0, 0, 0 };
+ int dstStride[] = { (int)nWidth*4, 0, 0, 0 };
int orientation = DegreeToOrientation(hint.orientation);
dllSwScale.sws_scale(context, src, srcStride, 0, picture.iHeight, dst, dstStride);
dllSwScale.sws_freeContext(context);
View
2  xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp
@@ -693,7 +693,7 @@ void CDVDInputStreamBluray::OverlayClear(SPlane& plane, int x,