Dear linuxsampler developers,
I have a problem while saving a newly created gig file with gigedit (saving existing files seems to work properly, from my few tests).

I do the following basic operations to have a valid gig file for being saved:

- open gigedit
- load a new sample
- create a region
- assign the sample to the region
- choose "save" from menu
- select path/filename
- click "save" button

Then gigedit freezes until I kill the process. A partial gig file is written to disk.

I tracked down the problem into the RIFF.cpp file, within the libgig library. The instruction causing the freeze of gigedit is

    iBytesMoved = read(pFile->hFileRead, pCopyBuffer, iBytesMoved);

line 868 of Chunk::WriteChunk method.

I could detect that iBytesMoved = 0 before the instruction. It should work anyway, but that's it.

Based on my observation, as a tentative patch, that actually seems to work, I introduced the following conditional:

    if (iBytesMoved) {   /* introduced this */
        iBytesMoved = read(pFile->hFileRead, pCopyBuffer, iBytesMoved);
        lseek(pFile->hFileWrite, ulWritePos + ulOffset, SEEK_SET);
        iBytesMoved = write(pFile->hFileWrite, pCopyBuffer, iBytesMoved);
    }

I add that tests in libgig/src/testcases/ seem to work fine.

Unfortunately I can not say much more, since I hadn't time to learn more about libgig internals to allow a deeper testing and a (hopefully) better fix. It took me a whole evening to learn from scratch about GIGs, DLSs and RIFFs :-P

I used the following CVS versions of the software

- libgig release3_3_0: 1.35.0.2
- gigedit release0_2_0: 1.5.0.2

Compiler

- gcc version 4.4.5 20100728 (prerelease) (Debian 4.4.4-8)
- ldd (Debian EGLIBC 2.11.2-2) 2.11.2

Best,
Tullio

PS: linuxsampler et al. look very nice piece of software, congratulations! hope to have the chance to contribute in some way...
<mailto:linuxsampler-devel@lists.sourceforge.net>
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to