Fix a buffer overflow in op_read_stereo().

For multichannel files, this potentially caused writes beyond the
 end of the output buffer provided by the user.
Minor comment fix.
Reset dither state when API path changes.

The caller can switch between the fixed/float APIs and the
 stereo/multichannel APIs on every call.
Detect this and reset the dither state to avoid potentially
 injecting noise from a very out-of-date state when switching from
 fixed to float back to fixed, or from the wrong channels when
 switching between stereo and multichannel.
Normal applications won't do this stuff, but we should be
 well-behaved if they do.
Use clipping prevention on 16-bit decode paths.

When we decode using libopus's fixed-point APIs, libopus internally
 applies soft clipping prevention.
When we decode using libopus's floating-point APIs, this behavior
 is disabled.
If we're ultimately planning to output the data to the user in
 fixed-point, we need to apply the clipping prevention ourselves.
Small cleanups of the soft clipping code.

- Made OP_SOFT_CLIP defined only when using floating point (libopus
   handles clipping when using the fixed-point API).
- Struct rearrangement for theoretically better packing on some
   platforms.
- Reset the state tracking channel count when re-initializing a
   decoder (and not the dither mute, because that gets reset for
   free).
Small public header clean-up.

stdarg.h should've been inside the include guard.
Fix Base64 encoding for HTTP's basic auth.

I thought I had tested this before, but it was sufficiently broken
 that clearly I had not.
Handle AC_SEARCH_LIBS special result value.

AC_SEARCH_LIBS will give a result of "none required" if the relevant
 function is available without any special libraries.
This is the case for lrintf on MinGW.
Make sure this special value isn't put verbatim into the pkg-config
 files, as it would cause the linker to search for files named
 "none" and "required", and fail.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Add some files to .gitignore

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Update opusfile.pc description line.

The library does not actually do any playback, as it does no sound
 output.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Fix pkg-config file to avoid overlinking

Libraries that are used internally by opusfile but are not part of
 its API should be listed in pkg-config "private" clauses.
Otherwise executables that are linked dynamically against opusfile
 will have unneeded direct dependencies (overlinking).

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Add casts to remove clang warnings.

Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Add docs to the website when releasing.
Add <sys/types.h> for off_t.

This shouldn't be necessary, but apparently on OS X 10.4 fseeko()
 takes fpos_t instead of off_t, and thus doesn't guarantee that
 off_t is defined.
Fix seeking near the start of saved live streams.

If a stream starts with a non-zero granpos, we would subtract 80 ms
 from the target time, and then report failure when the best page
 we could find (the first page in the link) had a granpos larger
 than that.
This worked for normal streams because the subtraction would fail
 (granpos can't wrap past -1) and we checked for that.
Fix 255 packet assertion.

If we actually have 255 packets on a page, this assertion always
 triggers, because ogg_stream_packetout doesn't fail until we ask
 for the _next_ packet.
Move last few URL functions into http.c

This makes it easier to split http.c and friends into their own
 library.
This allows distributions to ship a libopusfile with generic Opus
 parsing support, and a libopusurl with http/https support.
Keeping the latter in a separate library means that GPL
 applications don't have to link against the GPL-incompatible
 openssl, and distributions don't have to disable http support to
 allow GPL applications to use libopusfile.
Autoconf and pkg-config support for libopusurl
Allow the examples to build with --disable-http
Always build libopusurl

If --disable-http is used it will just only have file URL support.