shithub: opusfile

Download patch

ref: 4e06a90ef61ad34d9812fb4578a4c640f868ad00
parent: 428b6bc5e13be46d8a9f219a93f0af928c0aa8f4
author: Ron <[email protected]>
date: Mon May 13 09:13:26 EDT 2013

Allow the examples to build with --disable-http

--- a/examples/opusfile_example.c
+++ b/examples/opusfile_example.c
@@ -155,7 +155,11 @@
   }
   else{
     /*Try to treat the argument as a URL.*/
+#if defined(OP_ENABLE_HTTP)
     of=op_open_url(_argv[1],&ret,NULL);
+#else
+    of=NULL;
+#endif
 #if 0
     if(of==NULL){
       OpusFileCallbacks  cb={NULL,NULL,NULL,NULL};
--- a/examples/seeking_example.c
+++ b/examples/seeking_example.c
@@ -275,8 +275,12 @@
   if(strcmp(_argv[1],"-")==0)fp=op_fdopen(&cb,fileno(stdin),"rb");
   else{
     /*Try to treat the argument as a URL.*/
+#if defined(OP_ENABLE_HTTP)
     fp=op_url_stream_create(&cb,_argv[1],
      OP_SSL_SKIP_CERTIFICATE_CHECK(1),NULL);
+#else
+    fp=NULL;
+#endif
     /*Fall back assuming it's a regular file name.*/
     if(fp==NULL)fp=op_fopen(&cb,_argv[1],"rb");
   }