Even more stuff ;)
In the same file, oggread~.c there is a line that reads:
if((x->x_file = sys_fopen(filename->s_name, "r")) < 0)
But it should be:
if((x->x_file = sys_fopen(filename->s_name, "rb")) <= 0)
Now, to figure out how to submit a patch to pd-extended :P
On Fri, Apr 4, 2014 at 7:22 PM, Rafael Vega email.rafa@gmail.com wrote:
Forgot to say: this fixes my issue, I can now open and play ogg files.
On Fri, Apr 4, 2014 at 8:49 PM, Rafael Vega email.rafa@gmail.com wrote:
I think it's here:
http://sourceforge.net/p/pure-data/patches/
Martin
On 2014-04-04 21:49, Rafael Vega wrote:
I THink it should really be:
if((x->x_file = sys_fopen(filename->s_name, "r")) == 0)
sys_fopen returns NULL (also known as 0) on failure, otherwise a pointer; it makes no sense to check the sign of a pointer as far as I know.
cheers Miller
On Fri, Apr 04, 2014 at 11:21:37PM -0400, Martin Peach wrote:
Hi Miller,
On my windows machines (XP and 8.1), if I tried to open with mode 'r', the later call to ov_open would fail. If I change the mode to 'rb', the later call to ov_open works fine. I also read somewhere that the 'b' mode does nothing on Unix (I still have to test that when I'm back to my Linux and Mac machines).
As for the comparison against NULL, the original code was comparing
if((x->x_file = sys_fopen(filename->s_name, "r")) < 0)
And I changed it to <= instead. You are right in that it makes no sense to compare the sign of a pointer so == it is :)
R.
On Sat, Apr 5, 2014 at 9:03 AM, Miller Puckette msp@ucsd.edu wrote:
I also find it strange that using the external on pd-vanilla by copying the dll to the "extra" folder in the vanilla directory works fine. Any ideas why? Maybe has something to do with compiler environment differences between vanilla and extended? Do you guys use MinGW for both?
On Sat, Apr 5, 2014 at 10:34 AM, Rafael Vega email.rafa@gmail.com wrote:
I think vanilla is compiled with MSVC and extended with MinGW so there are incompatibilities in the c runtime especially where file pointers are concerned. Sometimes externals will work on both versions but if the external opens its own files using Pd functions to find the path then it probably won't.
Martin
On 2014-04-05 11:36, Rafael Vega wrote:
Extended on MinGW and my libpd project on MinGW show the same problem, that makes sense. Thanks, Martin!
On Sat, Apr 5, 2014 at 10:49 AM, Martin Peach martin.peach@sympatico.cawrote: