Changing output buffer size in dsp plugin
From: languy (jn_at_online.stofanet.dk)
Date: 08/26/04
- Next message: Neil Smith [MVP Digital Media]: "Re: Catch 'temp disk full error' while encoding from vbscript"
- Previous message: frank iversen: "WMP 9 loop , WMP 6.4 SDK"
- Next in thread: Jim Travis [ms]: "Re: Changing output buffer size in dsp plugin"
- Reply: Jim Travis [ms]: "Re: Changing output buffer size in dsp plugin"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 11:14:18 +0200
Hi There,
I have created a plugin which is able both to increase and decrease the
speed of an audio sample. In addition to this it will have influenze of the
length of the buffer. I.e. if the speed is increased, then the stream will
be shorter and opposite if the the speed is decreased the length of stream
will be longer. If the speed is slowed down it will unfortunately have the
side effect that the output buffer is overwritten - a buffer overrun -
therefore I need to find a way to realloc this output stream so it matches
the actual length of the stream.
>From the MSDN: "The Player allocates both an input buffer and an output
buffer and gives the plug-in access to both buffers."
What I can understand so far is that both buffers are allocated by the
player before they reach the plugin, which makes it much more complicated to
perform a realloc on them because the plugin doesn't have full control of
all pointers pointing to the buffers. I have already tried a couple of ways
but unfortunately not with a good result. I.e.:
1) performing the realloc in the DoProcessOutput
1.1) both by increasing the existing allocation (realloc) and
destroying/freeing the old and allocating with the new larger size
2) deallocating and allocating in the AllocateStreamingResources
2.1) both by increasing the existing allocation (realloc) and
destroying/freeing the old and allocating with the new larger size
2.2) when allocating, coping all properties from the old buffer into the new
allocated object
Does any one know a way around this, so it is possible to realloc the
buffers and prevent such a buffer overrun?
Thanks in regards,
Jess
- Next message: Neil Smith [MVP Digital Media]: "Re: Catch 'temp disk full error' while encoding from vbscript"
- Previous message: frank iversen: "WMP 9 loop , WMP 6.4 SDK"
- Next in thread: Jim Travis [ms]: "Re: Changing output buffer size in dsp plugin"
- Reply: Jim Travis [ms]: "Re: Changing output buffer size in dsp plugin"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|