<div dir="ltr">I also find it strange that using the external on pd-vanilla by copying the dll to the &quot;extra&quot; 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?<br>

<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 5, 2014 at 10:34 AM, Rafael Vega <span dir="ltr">&lt;<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Miller,<br></div><br>On my windows machines (XP and 8.1), if I tried to open with mode &#39;r&#39;, the later call to ov_open would fail. If I change the mode to &#39;rb&#39;, the later call to ov_open works fine. I also read somewhere that the &#39;b&#39; mode does nothing on Unix (I still have to test that when I&#39;m back to my Linux and Mac machines).<br>


</div><br>As for the comparison against NULL, the original code was comparing <br><div class=""><br>if((x-&gt;x_file = sys_fopen(filename-&gt;s_name, &quot;r&quot;)) &lt; 0)<br><br></div></div>And I changed it to  &lt;=  instead. You are right in that it makes no sense to compare the sign of a pointer so  ==  it is :)<br>


<br></div>R.<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sat, Apr 5, 2014 at 9:03 AM, Miller Puckette <span dir="ltr">&lt;<a href="mailto:msp@ucsd.edu" target="_blank">msp@ucsd.edu</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I THink it should really be:<br>
<br>
if((x-&gt;x_file = sys_fopen(filename-&gt;s_name, &quot;r&quot;)) == 0)<br>
<br>
sys_fopen returns NULL (also known as 0) on failure, otherwise a pointer;<br>
it makes no sense to check the sign of a pointer as far as I know.<br>
<br>
cheers<br>
<span><font color="#888888">Miller<br>
</font></span><div><div><br>
On Fri, Apr 04, 2014 at 11:21:37PM -0400, Martin Peach wrote:<br>
&gt; I think it&#39;s here:<br>
&gt;<br>
&gt; <a href="http://sourceforge.net/p/pure-data/patches/" target="_blank">http://sourceforge.net/p/pure-data/patches/</a><br>
&gt;<br>
&gt; Martin<br>
&gt;<br>
&gt; On 2014-04-04 21:49, Rafael Vega wrote:<br>
&gt; &gt;Even more stuff ;)<br>
&gt; &gt;<br>
&gt; &gt;In the same file, oggread~.c there is a line that reads:<br>
&gt; &gt;<br>
&gt; &gt;     if((x-&gt;x_file = sys_fopen(filename-&gt;s_name, &quot;r&quot;)) &lt; 0)<br>
&gt; &gt;<br>
&gt; &gt;But it should be:<br>
&gt; &gt;<br>
&gt; &gt;     if((x-&gt;x_file = sys_fopen(filename-&gt;s_name, &quot;rb&quot;)) &lt;= 0)<br>
&gt; &gt;<br>
&gt; &gt;Now, to figure out how to submit a patch to pd-extended :P<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;On Fri, Apr 4, 2014 at 7:22 PM, Rafael Vega &lt;<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a><br>
&gt; &gt;&lt;mailto:<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;    Follow up:<br>
&gt; &gt;<br>
&gt; &gt;    Looking at the code for oggread~, I found that it does the actual<br>
&gt; &gt;    opening of the file with<br>
&gt; &gt;<br>
&gt; &gt;         if(ov_open(x-&gt;x_file, &amp;x-&gt;x_ov, NULL, -1) &lt; 0)<br>
&gt; &gt;<br>
&gt; &gt;    on the ov_open documentation it warns windows programmers not to use<br>
&gt; &gt;    ov_open but ov_open_callbacks instead [1] and [2] so I changed that<br>
&gt; &gt;    line to the following and I&#39;m getting the message &quot;Bitstream does<br>
&gt; &gt;    not contain any Vorbis data&quot;. I&#39;m pretty sure my file is a valid ogg<br>
&gt; &gt;    file. I created it using audacity and also tried with an ogg file<br>
&gt; &gt;    downloaded from <a href="http://freesound.org" target="_blank">freesound.org</a> &lt;<a href="http://freesound.org" target="_blank">http://freesound.org</a>&gt;.<br>
&gt; &gt;<br>
&gt; &gt;    Any help with this will be very much appreciated<br>
&gt; &gt;<br>
&gt; &gt;    :)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;             int ret = ov_open_callbacks(x-&gt;x_file, &amp;x-&gt;x_ov, NULL, -1,<br>
&gt; &gt;    OV_CALLBACKS_DEFAULT);<br>
&gt; &gt;             switch(ret){<br>
&gt; &gt;                 case OV_EREAD:<br>
&gt; &gt;                      post(&quot;A read from media returned an error.&quot;);<br>
&gt; &gt;                      break;<br>
&gt; &gt;                 case OV_ENOTVORBIS:<br>
&gt; &gt;                     post(&quot;Bitstream does not contain any Vorbis data&quot;);<br>
&gt; &gt;                     break;<br>
&gt; &gt;                 case OV_EVERSION:<br>
&gt; &gt;                     post(&quot;OV_EVERSION - Vorbis version mismatch.&quot;);<br>
&gt; &gt;                     break;<br>
&gt; &gt;                 case OV_EBADHEADER:<br>
&gt; &gt;                     post(&quot;Invalid Vorbis bitstream header.&quot;);<br>
&gt; &gt;                     break;<br>
&gt; &gt;                 case OV_EFAULT:<br>
&gt; &gt;                     post(&quot;Internal logic fault; indicates a bug or<br>
&gt; &gt;    heap/stack corruption.&quot;);<br>
&gt; &gt;                     break;<br>
&gt; &gt;             }<br>
&gt; &gt;             if(ret &lt;0)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;    links:<br>
&gt; &gt;<br>
&gt; &gt;    [1] <a href="http://xiph.org/vorbis/doc/vorbisfile/ov_open_callbacks.html" target="_blank">http://xiph.org/vorbis/doc/vorbisfile/ov_open_callbacks.html</a><br>
&gt; &gt;    [2] <a href="http://xiph.org/vorbis/doc/vorbisfile/ov_open.html" target="_blank">http://xiph.org/vorbis/doc/vorbisfile/ov_open.html</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;    On Fri, Apr 4, 2014 at 5:48 PM, Rafael Vega &lt;<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a><br>
&gt; &gt;    &lt;mailto:<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;        Hi.<br>
&gt; &gt;<br>
&gt; &gt;        I am trying to use [oggread~] external on an application i&#39;m<br>
&gt; &gt;        developing with libpd. No problems on mac or linux. Howerver, on<br>
&gt; &gt;        windows (xp and 8, 32bit) I keep getting an error message from<br>
&gt; &gt;        oggread~ when I try to open an ogg file. Even ogg_read~-help.pd<br>
&gt; &gt;        won&#39;t work:<br>
&gt; &gt;<br>
&gt; &gt;        oggread~: file &quot;C:/Users/rv/any.ogg&quot; opened<br>
&gt; &gt;        oggread~: error: could not open &quot;C:/Users/rv/Desktop/any.ogg&quot; as<br>
&gt; &gt;        an OggVorbis file<br>
&gt; &gt;        oggread~: file closed due to error<br>
&gt; &gt;<br>
&gt; &gt;        I have tried pd-extended (both installer and standalone) and I<br>
&gt; &gt;        also compiled oggread~ into my application and loaded it with<br>
&gt; &gt;        libpd, same outcome.<br>
&gt; &gt;<br>
&gt; &gt;        The weirdest part is that if I run pd vanilla, copy oggread~.dll<br>
&gt; &gt;        from pd-extended into the &quot;extra&quot; directory, the ogg files are<br>
&gt; &gt;        opened correctly.<br>
&gt; &gt;<br>
&gt; &gt;        Any ideas on how to make this work? What kind of debug info can<br>
&gt; &gt;        I provide?<br>
&gt; &gt;<br>
&gt; &gt;        --<br>
&gt; &gt;        Rafael Vega<br>
&gt; &gt;        <a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a> &lt;mailto:<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;    --<br>
&gt; &gt;    Rafael Vega<br>
&gt; &gt;    <a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a> &lt;mailto:<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;--<br>
&gt; &gt;Rafael Vega<br>
&gt; &gt;<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a> &lt;mailto:<a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a>&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;_______________________________________________<br>
&gt; &gt;Pd-dev mailing list<br>
&gt; &gt;<a href="mailto:Pd-dev@iem.at" target="_blank">Pd-dev@iem.at</a><br>
&gt; &gt;<a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Pd-dev mailing list<br>
&gt; <a href="mailto:Pd-dev@iem.at" target="_blank">Pd-dev@iem.at</a><br>
&gt; <a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div>Rafael Vega<br></div><a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a></div>


</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Rafael Vega<br></div><a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a></div>
</div>