1. 20 Nov, 2013 4 commits
  2. 03 Sep, 2013 12 commits
    • Timothy B. Terriberry's avatar
      Fix a parentheses error in op_utf8_to_utf16(). · 779ea4da
      Timothy B. Terriberry authored
      For many Latin1 characters this still worked correctly by pure luck.
      Unfortunately, that included my test case.
      779ea4da
    • Timothy B. Terriberry's avatar
      Fix a granpos calculation we assumed couldn't fail. · d6697905
      Timothy B. Terriberry authored
      It was only guaranteed to work in the seekable case.
      Thanks to Radio Stadtfilter 96.3Mhz for sending a stream which
       triggered this failure.
      d6697905
    • Timothy B. Terriberry's avatar
      %s/op_read_native_filter/op_filter_read_native/g · 2ab13b78
      Timothy B. Terriberry authored
      All the actual filters are named op_foo_filter(), so
       op_read_native_filter() looked like another one.
      Changing the word order should remove the ambiguity.
      2ab13b78
    • Timothy B. Terriberry's avatar
      Mark more internal pointers const. · e6e2b83b
      Timothy B. Terriberry authored
      Don't know if this actually leads to any better code generation,
       but it may make the code a little clearer.
      e6e2b83b
    • Timothy B. Terriberry's avatar
      Mark a bunch of API functions const. · 23c8a83d
      Timothy B. Terriberry authored
      This makes it clear they don't modify the state, which is a useful
       indicator of what is safe to call from the application decode
       callback.
      23c8a83d
    • Timothy B. Terriberry's avatar
      Minor simplification to end-trimming logic. · 4d75f855
      Timothy B. Terriberry authored
      This is a little easier to read, and allows us to save some
       subtractions and a comparison.
      4d75f855
    • Timothy B. Terriberry's avatar
      Get rid of the op_float2short_filter() wrapper. · 80751579
      Timothy B. Terriberry authored
      The increasingly-inaccurately named op_shaped_dither16() can serve
       this role instead, without much additional complexity (perhaps
       less, once you consider the required shuffling around of the
       function parameters).
      80751579
    • Timothy B. Terriberry's avatar
      Add an API to disable dithering. · 8396a1f8
      Timothy B. Terriberry authored
      This is to correspond to the feature in opus-tools's opusdec.
      opusdec itself probably won't be able to use it, because it still
       wants to do dithering after resampling, but the motivation for the
       feature is the same.
      8396a1f8
    • Timothy B. Terriberry's avatar
      Avoid clipping in short->float stereo downmixing. · a88a90f9
      Timothy B. Terriberry authored
      Previously I'd said this would require a large stack buffer, which
       was true if you simply wanted to re-use the existing
       op_short2float_filter() and floating-point op_stereo_filter().
      But the latter is not normally compiled for fixed-point anyway, so
       we can instead write new code that doesn't need the stack buffer
       without harming anything.
      a88a90f9
    • Timothy B. Terriberry's avatar
      Remove some OP_UNLIKELY macros. · 49233ebf
      Timothy B. Terriberry authored
      These were unlikely when I originally expected applications to
       normally provide a decode buffer in the right format of sufficient
       size.
      However, the decode filter API works by asking to decode into a
       0-byte buffer, which will trigger both of these tests on every
       packet.
      Since this is how three of the four decoding APIs are implemented,
       this is not really that unlikely anymore.
      49233ebf
    • Timothy B. Terriberry's avatar
      Minor decode control flow updates. · e0ab29d4
      Timothy B. Terriberry authored
      This makes op_fetch_and_process_page() always try to fetch another
       page, like it used to (and like its name implies).
      There was only one place where we needed the early return for
       unprocessed packets, and getting rid of that actually simplifies
       the logic there (replacing a conditional continue with an
       unconditional one in a slightly different location).
      e0ab29d4
    • Timothy B. Terriberry's avatar
      Add an application decoding callback API. · 1b114a82
      Timothy B. Terriberry authored
      This is needed to allow advanced usage, like that of opusdec in
       opus-tools, which can simulate packet loss or save the range coder
       state for decoder verification.
      It could also be used in a pinch to use libopusfile for access to
       the raw Ogg packets, though this is somewhat of a hack.
      1b114a82
  3. 25 Aug, 2013 1 commit
  4. 24 Aug, 2013 2 commits
    • Timothy B. Terriberry's avatar
      Expose tag comparison functions. · 046b089d
      Timothy B. Terriberry authored
      It seems somewhat silly to have to write your own strcasecmp to
       satisfy the usage pattern found in opusfile_example: scanning the
       whole tags list and handling certain tags specially (as opposed to
       searching for specific tags, as opus_tags_query() does).
      Given that we were already using an equivalent function internally
       to implement opus_tags_query, just expose it directly.
      046b089d
    • Timothy B. Terriberry's avatar
      Replace 0x7FFFFFFF by new OP_INT32_MAX. · 0e4b81e1
      Timothy B. Terriberry authored
      OP_INT32_MIN and OP_INT32_MAX were added in commit 97917914.
      This fixes at least one bug, since one of the (extremely unlikely)
       overflow checks had an extra F in it.
      0e4b81e1
  5. 23 Aug, 2013 2 commits
    • Timothy B. Terriberry's avatar
      Add API to report information from server headers. · 97917914
      Timothy B. Terriberry authored
      This allows the application to report details about the server for
       HTTP[S] streams.
      For all HTTP[S], this includes the server software, content-type,
       and whether or not it's using HTTPS.
      For live streams, it also includes the station name, description,
       genre, homepage, nominal bitrate, and whether or not it's publicly
       listed.
      97917914
    • Timothy B. Terriberry's avatar
      Fix backwards HTTP Server header test. · f310b9ef
      Timothy B. Terriberry authored
      This was treating every unknown header as a Server header.
      Good thing this was last!
      The only damage was that we might have enabled pipelining even on
       known-bad servers.
      f310b9ef
  6. 21 Aug, 2013 1 commit
  7. 12 Aug, 2013 2 commits
    • Timothy B. Terriberry's avatar
      Fix an uninitialized variable. · 8f26e5a1
      Timothy B. Terriberry authored
      Surprisingly, the actual initial value of this variable is
       irrelevant, since we always insert 24 bits of data into and then
       read only those bits out.
      However, fixing this still removes undefined behavior and removes
       extraneous register dependencies.
      8f26e5a1
    • Timothy B. Terriberry's avatar
      Minor UTF-8/UTF-16 cleanups. · cfa59561
      Timothy B. Terriberry authored
      - Reject 'not a character' values 0xFFFE and 0xFFFF.
      - Remove some unnecessary string length checks.
      cfa59561
  8. 10 Aug, 2013 1 commit
  9. 06 Aug, 2013 3 commits
  10. 15 Jul, 2013 3 commits
    • Timothy B. Terriberry's avatar
      Add a gain control API. · 7aea3cae
      Timothy B. Terriberry authored
      A new op_set_gain_offset() allows the application to provide its own
       offset to the current decoder gain setting, as well as specify what
       offsets should be applied.
      The header gain alone is still the default, but the application may
       also request that the track gain be applied, or that neither be
       applied.
      
      In addition, an op_get_track_gain() function can parse the track
       gain out of a set of comment tags.
      This is mainly provided as a convenience for applications that need
       this information, so they don't have to write their own parser.
      7aea3cae
    • Timothy B. Terriberry's avatar
      Plug possible memory leak on stream open failure. · 68f18feb
      Timothy B. Terriberry authored
      Not all the failure paths cleaned up after themselves properly.
      Thanks to tangobravo for complaining about similar issues in
       libvorbisfile, which prompted me to audit this code.
      68f18feb
    • Timothy B. Terriberry's avatar
      Avoid using a long-long literal for OP_INT64_MAX. · 6587f1de
      Timothy B. Terriberry authored
      The LL suffix isn't C89, so it may not work everywhere.
      6587f1de
  11. 28 Jun, 2013 1 commit
  12. 13 May, 2013 1 commit
    • Timothy B. Terriberry's avatar
      Move last few URL functions into http.c · 5e3c66ce
      Timothy B. Terriberry authored
      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.
      5e3c66ce
  13. 08 May, 2013 1 commit
    • Timothy B. Terriberry's avatar
      Fix 255 packet assertion. · efc0d57a
      Timothy B. Terriberry authored
      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.
      efc0d57a
  14. 07 May, 2013 1 commit
    • Timothy B. Terriberry's avatar
      Fix seeking near the start of saved live streams. · 2862e2ea
      Timothy B. Terriberry authored
      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.
      2862e2ea
  15. 01 May, 2013 1 commit
  16. 30 Apr, 2013 1 commit
  17. 28 Apr, 2013 1 commit
  18. 06 Apr, 2013 1 commit
    • Timothy B. Terriberry's avatar
      Small cleanups of the soft clipping code. · 7b499048
      Timothy B. Terriberry authored
      - 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).
      7b499048
  19. 25 Mar, 2013 1 commit
    • Timothy B. Terriberry's avatar
      Use clipping prevention on 16-bit decode paths. · bf06c4f2
      Timothy B. Terriberry authored
      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.
      bf06c4f2