[mythtv] [PATCH] for mythgame xml parsing (need help)

Joseph A. Caputo jcaputo1 at comcast.net
Fri Aug 27 09:06:50 EDT 2004

On Friday 27 August 2004 06:59, Charlie Brej wrote:
> Charlie Brej wrote:
> > I wrote a patch for mythgame to read the new xml format for the
> > game info but Im getting crashes in a Qt call. I'm using the Qt xml
> > module just like in filldata. Unfortunately it crashes while
> > reading the file in the setContent function. Which is in Qt but it
> > eventually crashes in libc++. It seems happy reading a dummy xml
> > (xmltv) file but not the one generated by xmame.
> > Anyone care to give me a hand?
> Ah yeah. It would help if I attached it.

Well, I'm no expert in this area, but after looking at your patch I have 
a few thoughts:

- The documentation for QFile says that when using QFile::open(int, FILE 
*), if the FILE * is stdin, stdout or stderr, seeking may be disabled.  
I have to wonder if opening a pipe also disables QFile seeking, which 
might cause problems with QDomDocument::setContent()...

- I wonder if, since you're opening a FILE * connected to a pipe, you 
need to rewind the QFile before reading from it...

- Another option might be to use QProcess instead of a command pipe; 
then you could read stdout of the QProcess into a QByteArray and pass 
that into QDomDocument::setContent() ...

- or, you could just redirect the stdout of the xmame command to a temp 
file instead of a pipe and read that file normally.

- Also, if you have Qt built with debug enabled, you could see why it's 
crashing under gdb.



More information about the mythtv-dev mailing list