{"action":"created","issue":{"url":"https://api.github.com/repos/nothings/stb/issues/117","labels_url":"https://api.github.com/repos/nothings/stb/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/nothings/stb/issues/117/comments","events_url":"https://api.github.com/repos/nothings/stb/issues/117/events","html_url":"https://github.com/nothings/stb/issues/117","id":72370535,"number":117,"title":"support for seeking in stb_vorbis.c  (bounty)","user":{"login":"nothings","id":7525026,"avatar_url":"https://avatars.githubusercontent.com/u/7525026?v=3","gravatar_id":"","url":"https://api.github.com/users/nothings","html_url":"https://github.com/nothings","followers_url":"https://api.github.com/users/nothings/followers","following_url":"https://api.github.com/users/nothings/following{/other_user}","gists_url":"https://api.github.com/users/nothings/gists{/gist_id}","starred_url":"https://api.github.com/users/nothings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nothings/subscriptions","organizations_url":"https://api.github.com/users/nothings/orgs","repos_url":"https://api.github.com/users/nothings/repos","events_url":"https://api.github.com/users/nothings/events{/privacy}","received_events_url":"https://api.github.com/users/nothings/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nothings/stb/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nothings/stb/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/nothings/stb/labels/stb_vorbis","name":"stb_vorbis","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-05-01T06:54:00Z","updated_at":"2015-07-04T00:52:13Z","closed_at":null,"body":"**Someone has currently declared their intent to pursue this. Historically, multiple people have looked at this and given up, though, so it may re-open.**\r\n\r\nstb_vorbis is this single-file C library for decoding ogg vorbis files: https://github.com/nothings/stb/blob/master/stb_vorbis.c\r\n\r\nstb_vorbis doesn't have correctly-working seek functionality (e.g. being able to say 'start playback from sample number 31415926').\r\n\r\nThe bounty for a correct implementation of this feature is 5000 USD. (It may go down again in a few months as the current amount is the sum of several individuals who may drop out if it doesn't get done soon enough.) Please let me know if you are working on it to make sure we don't end up with two people doing it at the same time, as only one correct implementation will be paid out.\r\n\r\nRequirements:\r\n- seeking must be sample-accurate\r\n- reasonably efficient (binary search, interpolation search, etc)\r\n- cannot generate an off-line index or scan the whole file at start\r\n- changes must be placed in the public domain\r\n- you can start with the existing non-working implementation of seek (see below) or start from scratch\r\n- you'll need to learn about both the ogg specification and the vorbis specification to do this (see the link below for some insight why)\r\n- I (@nothings) am available to provide guidance about what the existing code is doing (aka write better comments)\r\n\r\nCurrent status in the code:\r\n- there is a 2007 implementation of seeking in the code which doesn't work. I no longer remember the details of how it doesn't work. I wrote this document about the frustrations of trying to do a performance-optimal implementation: http://nothings.org/stb_vorbis/ogg_seek.txt but at this point I will accept some suboptimality.\r\n- the \"pushdata\" API supports an approximate seeking; this is satisfactory for the pushdata API but not for the normal (\"pulldata\") API. you can just ignore the pushdata case"},"comment":{"url":"https://api.github.com/repos/nothings/stb/issues/comments/118447027","html_url":"https://github.com/nothings/stb/issues/117#issuecomment-118447027","issue_url":"https://api.github.com/repos/nothings/stb/issues/117","id":118447027,"user":{"login":"MadDavid","id":12563299,"avatar_url":"https://avatars.githubusercontent.com/u/12563299?v=3","gravatar_id":"","url":"https://api.github.com/users/MadDavid","html_url":"https://github.com/MadDavid","followers_url":"https://api.github.com/users/MadDavid/followers","following_url":"https://api.github.com/users/MadDavid/following{/other_user}","gists_url":"https://api.github.com/users/MadDavid/gists{/gist_id}","starred_url":"https://api.github.com/users/MadDavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadDavid/subscriptions","organizations_url":"https://api.github.com/users/MadDavid/orgs","repos_url":"https://api.github.com/users/MadDavid/repos","events_url":"https://api.github.com/users/MadDavid/events{/privacy}","received_events_url":"https://api.github.com/users/MadDavid/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T00:52:13Z","updated_at":"2015-07-04T00:52:13Z","body":"Your comments on point 1 are fair enough, except that I did not say \n\"I'll help him for free,\" I said, \"we could work together to finish it.  \nI also said, on May 28th, \"I'm proposing we work together ... and split \nthe bounty.\"  I understand your objections to unpaid work, and agree \nwith you scrubbing the word 'bounty', but this means you should \nunderstand my objections to my own contributions going unpaid.\n\nRe:  \"The impression I came away from afinostux's email after that \n(IIRC, I'd have to check my email to be sure) was that he was of the \nopinion that your solution didn't meet the constraints I'd put on it \n(specifically, I forbade solutions that scanned the entire file first, \nwhich--again, IIRC--he said you said you were doing). If source code was \nshown then, it is the first I've heard of it. (Maybe you were trying to \nsay that with \"I put together what I had\", but it wasn't quite clear.)\"\n\nMy own code pre-scans the file once when it is opened.  The version I \nsent to Afinostux had a place for a function call that merely needed to \nlocate the page prior to the packet with a known granule position, and \nother functions to read the packets without decoding, from there until \nthe nearest point before the pcm sample at which you can start decoding. \n  Quite frankly, for heavy-duty seeking I think that performing a binary \nfile seek is an awkward and time-consuming solution, but my code \nsupported using it to find the needed page and packets.\n\nRe: \"I don't even know what that is asking since that is like 90% of the \nproblem that has to be solved in the first place.\"\nMaybe, but that's news to me, since the ogg people seemed to think that \na binary file search would be the *standard* method of seeking a \nspecific page, and when I looked for solutions on-line, *everyone* was \nasking how to avoid decoding from the previous granule position.  No one \nwas asking how to bisect the file to find the correct page.  So 90% of \nthe code is doing something everyone knows how to do, it's still not 90% \nof the problem."}}