Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: oggdec.c compilation problem (Read 4694 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

oggdec.c compilation problem

I'm trying to write a plugin for an installer to enable it to convert ogg files to wav files and also playback ogg files.

After having a look at some ogg implementations I descided that the source code for oggdec.exe was the most appriopriate starting point for the plugin.  After countless hours of trying to get the dll to compile, libvorbis and other ogg libraries are compiled with MSVC and my compiler does not like those libraries, I almost got it to work.

No matter where I searched though I could not find the source code for dither_output function.  If I comment out the relevant function call in oggdec.c, which is called unless the sound file is in float format, the dll compiles and when run in ogg2wav mode produces a wave file of the right size, however the wave file does not contain any sound. 

Running this version of the dll in play mode produces an error saying that the memory address 'x' could not be read from 'y', or something along those lines.  I assume that both of these problems are related to the removed call to dither_output function.

So has anyone come across this problem before and how would one go about solving it?

Vytautas

PS. I hope that I'm in the right forum.

oggdec.c compilation problem

Reply #1
You must be using my oggdec, I guess.  The 'dither_output' function begins at line# 248 in oggdec.c. You can just copy the function over to wherever you want it.

oggdec.c compilation problem

Reply #2
Thanks, and don't I feel like an idiot.  I was using that file and usually I only comment out unused functions when I'm trying to get a program to compile.  But for some strange reason I actually deleted one function and guess which one it was. 

Yes the plugin now works fine, just a bit more cosmetic work to do but I should be able to handle that.

Just as a side note/question when I use the play function the plugin does not return the control to the program until it has finished playing the song.  Is there any way aroung that?

Vytautas 

oggdec.c compilation problem

Reply #3
I am sure the answer must be, yes, but don't ask me how in the sense that my code was not required to do that. You may get a clue to that from looking at the source for Winamp plugins.

oggdec.c compilation problem

Reply #4
Thanks, I figgured that out.  Had to make the player function run in a different thread.

I noticed that when converting from ogg to wav the cpu usage is around 100% is that normal or have I done something wrong?

Vytautas

oggdec.c compilation problem

Reply #5
Quote
Thanks, I figgured that out.  Had to make the player function run in a different thread.

I noticed that when converting from ogg to wav the cpu usage is around 100% is that normal or have I done something wrong?

Vytautas

Pretty much normal. It will take all it can get, but with a reasonably powered processor will survive on a lot less. Disabling the dithering will ease the requirement if it becomes critical.

oggdec.c compilation problem

Reply #6
Not sure how critical that would be, will have to talk to other devs to get their opinions.  When you say disable the dithering, won't that take me back to the problem with an emply wave file?

Vytautas

BTW your help is greatly appreaciated 

oggdec.c compilation problem

Reply #7
Quote
Not sure how critical that would be, will have to talk to other devs to get their opinions.  When you say disable the dithering, won't that take me back to the problem with an emply wave file?

Vytautas

BTW your help is greatly appreaciated 

I meant disabling dithering as an option, it will still simply pass through that function and generate normal undithered output.

oggdec.c compilation problem

Reply #8
Do you mean setting dithering to 0?  If thats the case it was always disabled.

The guy I have to speak to about the CPU usage appears to be away at the moment, can't find him anywhere 

I saw some posts in this forum about optimized versions of vorbis, but I assume that those optimizations were only for the encoders or do they apply to decoding also?

Vytautas

PS. The e-mail notification feature does not seem to be working for me for some reason. 

oggdec.c compilation problem

Reply #9
Quote
Do you mean setting dithering to 0?  If thats the case it was always disabled.

The guy I have to speak to about the CPU usage appears to be away at the moment, can't find him anywhere  

I saw some posts in this forum about optimized versions of vorbis, but I assume that those optimizations were only for the encoders or do they apply to decoding also?

Vytautas

PS. The e-mail notification feature does not seem to be working for me for some reason. 

So far as I'm aware, it's encoders only.

oggdec.c compilation problem

Reply #10
john33 is there a way to gracefully stop an ogg stream from playing?  I have it setup in a different thread and when I try to stop it it produces a couple of errors.

Vytautas

 

oggdec.c compilation problem

Reply #11
I think you'll probably find the answer to that if you have a look through the foobar SDK.