Welcome Guest ( Log In | Register )

ov_read on macosx giving 0es and -128
post May 2 2011, 17:36
Post #1

Group: Members
Posts: 1
Joined: 2-May 11
Member No.: 90270

I've stumbled upon a rather strange problem. At least its strange for me. I'm going crazy here, not knowing if its some compiler setting i need to change or something in the code, or something with the libraries i compiled.
Story goes like this: im trying to add ogg vorbis support to a multiplatform application im working on. The very same code works perfectly fine on windows and on iphone device, but does not work on macosx.
After lots of testing and checking every little piece of code, ive come to conclusion that the only difference is how the ov_read function behaves on those platforms.
On windows and iphone im getting proper values, but on macosx im getting a steady flow of repeated "0,-128, 0,-128" values in the decoded buffer. I've tried changing the endianness parameter just in case, tried changing the word size parameter - all for nothing. ov_read_float works fine on all three platforms, so if i dont figure out how to fix ov_read using ov_read_float is my last resort.
The strengest thing in all this is the fact that if i allow ov_read to run, it probably causes some memory errors, since after decoding the file, every other ogg file i try to load gives me a -133 error (bad header) in ov_open_callbacks (or ov_open. i tried with both). I'm hoping someone experienced something similar and could guide me in some direction. I'm not posting too much code as its pretty much just copy paste from tutorials, and it works perfectly fine on two other machines, so i would guess its either something compiler specific in my xcode, or im handling the ov_read in a bad way.
int size = ov_read(&vf, myBuffer, 4096, 0, 2, 1, &current_section);
for(int i = 0 ; i < 4096 ; ++i)

this prints on my screen either values like "0,0,0,0,0,0,1,0,-1,-1,-1,-3,9,-15 (...)" (working ok on windows/iphone)
"0,0,0,-128,0,-128,0,-1,0,-2,-128,-128,-128,-128,-128,-128 (...)" (working not ok on macosx)
Any advice would be helpful. Thanks!

This post has been edited by kt2009: May 2 2011, 17:40
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 1st December 2015 - 01:18