• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
[PATCH] Building SDL/OpenGL port on Windows (Win32)
#1
I recently had some free time so I worked on the SDL/OpenGL port and got it semi-functional under windows.

Current Issues:
  • Loading a python script causes it to crash.
  • Video playback is half working. The audio plays normally but the video playback is a slideshow (roughly 1 FPS).
  • Generating thumbnails for videos or photos causes it to crash.
  • If you select the video, audio, or photo browser menus and unhandled exception error comes up although the program will continue to run normally after you dismiss it. Roughly 60 seconds later, however, the program will suddenly terminate.

The patch is available on Sourceforge here.

If you want to run it yourself to see the bugs, crashes and logs you can get a build here
Reply
#2
Cool - I didn't need to add anything WRT critical sections last time (i.e. the xbox version worked just fine) but I guess some things may have changed in that respect.

I don't have time to check it out till at least next week, but perhaps someone else may have time to look at it before then.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
jmarshall Wrote:Cool - I didn't need to add anything WRT critical sections last time (i.e. the xbox version worked just fine) but I guess some things may have changed in that respect.

In the current version of the linux port the CriticalSection class is now just a wrapper around the XCriticalSection class which contains the platform specific functions.
Reply
#4
brief comments;

contains ALOT of cosmetics (in particular eol changes) - ditch these please.
Code:
Index: xbmc/cores/dvdplayer/DVDPlayer.cpp^M
===================================================================^M
--- xbmc/cores/dvdplayer/DVDPlayer.cpp  (revision 11438)^M
+++ xbmc/cores/dvdplayer/DVDPlayer.cpp  (working copy)^M
@@ -22,7 +22,11 @@^M
#include "../../Picture.h"
#include "../ffmpeg/DllSwScale.h"

-#include "../../xbmc/utils/PerformanceSample.h"
+#ifdef HAS_PERFORMACE_SAMPLE
+#include "../../utils/PerformanceSample.h"
+#else
+#define MEASURE_FUNCTION
+#endif
PERFORMACE?
Code:
Index: xbmc/utils/HTTP.h^M
===================================================================^M
--- xbmc/utils/HTTP.h   (revision 11438)^M
+++ xbmc/utils/HTTP.h   (working copy)^M
@@ -51,7 +51,7 @@^M

   CAutoPtrSocket m_socket;
#ifndef _LINUX
-  WSAEVENT hEvent;
+  void * hEvent;
why this change? and in any case; while there's the ever-lasting void* foo vs void *foo; a space there does not make an acceptable compromise Wink
Reply
#5
spiff Wrote:brief comments;

contains ALOT of cosmetics (in particular eol changes) - ditch these please.
Done. Sorry about that.

spiff Wrote:PERFORMACE?

why this change? and in any case; while there's the ever-lasting void* foo vs void *foo; a space there does not make an acceptable compromise Wink

The change in DVDPlayer.cpp was due to the program not building properly if HAS_PERFORMANCE_SAMPLE was undefined.

The change in HTTP.h was due to some strange header inclusion problems I was encountering. WHen trying to compile ScraperParser the compiler complains that WSAEVENT is undefined and since WSAEVENT is just a HANDLE which is just a void * I made the change to temporarily fix the problem.

I'm making the necessary fixes to the patch and will resubmit it in a little while.
Reply
#6
cool.

the HAS_PERFORMACE comment still applies though. look, no N.
Reply
#7
spiff Wrote:PERFORMACE?

Oh, I just remembered I cut and pasted that #ifdef statement from Application.cpp. I just looked in the current svn repository to confirm my suspicions and it is spelled wrong there too.
Reply
#8
aha.

well, then the use of wrong spelling is okay, and i will look in the log to figure out who to shout at Smile
Reply
#9
I cleaned up the patch and resubmitted it. It can be found here.
Reply
#10
I took the liberty of closing out your old patch as a dupe.
Reply
#11
Thanks for deleting the old patch.

It turns out that most of the unhandled exception errors were due to an improper compiler setting (needs /EHa) that caused it to ignore XBMCs built-in exception handler. Setting this properly fixed the non-fatal errors that would come up every time a thread was started.

There is still a crashing problem that I have tracked to the DLL unloader. It seems that when the last loaded DLL is unloaded a crash occurs with the log showing messages about memory leaks. It doesn't matter what DLL is the last unloaded, the log messages and crash happens every time.
Reply
#12
I tracked down the bug that was causing problems when unloading the DLLs. In the file dll_tracker.cpp the function void tracker_dll_free(DllLoader* pDll) basically works thusly:

Code:
for (TrackedDllsIter it = g_trackedDlls.begin(); it != g_trackedDlls.end(); ++it)
{
  if ((*it)->pDll == pDll)
  {
    //Do deletion stuff here.
    
    delete (*it);
    it = g_trackedDlls.erase(it);
  }
}

The problem comes after you call erase on the last item in the list. After doing so the variable "it" is set to the value of g_trackedDlls.end() and when it goes back to the top of the loop and tries to iterate the iterator that is at the end of the list a crash occurs. The solution I used is as follows:

Code:
for (TrackedDllsIter it = g_trackedDlls.begin(); it != g_trackedDlls.end();)
{
  if ((*it)->pDll == pDll)
  {
    //Do deletion stuff here.
    
    delete (*it);
    it = g_trackedDlls.erase(it);

    if(it != g_trackedDlls.end())
      ++it;
  }
}

This way there is no chance of trying to iterate an iterator that is already at the end of the list. This single fix took care of both the seemingly random crashes during usage as well as the crashes on exit that I was experiencing.

Now if I can just find out why video images display at 1 FPS while the sound plays normally the SDL/GL version should have all of it's basic functionality running under Windows.
Reply
#13
Sounds good. Time to fork another Forum Dev folder for Win32? Wink
Reply
#14
The code in the previous post still skips over items if a DLL is removed from the list. It should be

Code:
for (TrackedDllsIter it = g_trackedDlls.begin(); it != g_trackedDlls.end();)
{
  if ((*it)->pDll == pDll)
  {
    //Do deletion stuff here.
    
    delete (*it);
    it = g_trackedDlls.erase(it);
  }
  else
  {
    ++it;
  }
}
Reply
#15
Intrigued to see how it runs can you post a link to your latest build? Noticed the 1st post but seems quite unstable and dont need all the other bits, just the exe Smile

Keep up the good work Wink
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
[PATCH] Building SDL/OpenGL port on Windows (Win32)0