{"action":"created","comment":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/35531074","id":35531074,"diff_hunk":"@@ -1,122 +1,66 @@\n #include <QtDebug>\n #include <QFileInfo>\n+#include <QMutexLocker>\n \n #include \"controlobject.h\"\n #include \"controlobjectthread.h\"\n \n #include \"cachingreaderworker.h\"\n-#include \"trackinfoobject.h\"\n-#include \"sampleutil.h\"\n #include \"soundsourceproxy.h\"\n #include \"util/compatibility.h\"\n #include \"util/event.h\"\n-#include \"util/math.h\"\n-\n-\n-// One chunk should contain 1/2 - 1/4th of a second of audio.\n-// 8192 frames contain about 170 ms of audio at 48 kHz, which\n-// is well above (hopefully) the latencies people are seeing.\n-// At 10 ms latency one chunk is enough for 17 callbacks.\n-// Additionally the chunk size should be a power of 2 for\n-// easier memory alignment.\n-// TODO(XXX): The optimum value of the \"constant\" kFramesPerChunk\n-// depends on the properties of the AudioSource as the remarks\n-// above suggest!\n-const SINT CachingReaderWorker::kChunkChannels = Mixxx::AudioSource::kChannelCountStereo;\n-const SINT CachingReaderWorker::kFramesPerChunk = 8192; // ~ 170 ms at 48 kHz\n-const SINT CachingReaderWorker::kSamplesPerChunk = kFramesPerChunk * kChunkChannels;\n-\n-CachingReaderWorker::CachingReaderWorker(QString group,\n-        FIFO<ChunkReadRequest>* pChunkReadRequestFIFO,\n+\n+\n+CachingReaderWorker::CachingReaderWorker(\n+        QString group,\n+        FIFO<CachingReaderChunkReadRequest>* pChunkReadRequestFIFO,\n         FIFO<ReaderStatusUpdate>* pReaderStatusFIFO)\n         : m_group(group),\n           m_tag(QString(\"CachingReaderWorker %1\").arg(m_group)),\n           m_pChunkReadRequestFIFO(pChunkReadRequestFIFO),\n           m_pReaderStatusFIFO(pReaderStatusFIFO),\n+          m_maxReadableFrameIndex(Mixxx::AudioSource::getMinFrameIndex()),\n           m_stop(0) {\n }\n \n CachingReaderWorker::~CachingReaderWorker() {\n }\n \n-void CachingReaderWorker::processChunkReadRequest(\n-        ChunkReadRequest* request,\n+void CachingReaderWorker::processCachingReaderChunkReadRequest(\n+        CachingReaderChunkReadRequest* request,\n         ReaderStatusUpdate* update) {\n-    //qDebug() << \"Processing ChunkReadRequest for\" << chunk_number;\n+    //qDebug() << \"Processing CachingReaderChunkReadRequest for\" << chunk_number;\n \n-    // Initialize the output parameter\n+    // Initialize the output parameters\n+    update->maxReadableFrameIndex = m_maxReadableFrameIndex;","path":"src/cachingreaderworker.cpp","position":59,"original_position":59,"commit_id":"7c37e39aa2902ad79c09a71cf2cf555cde31005d","original_commit_id":"7c37e39aa2902ad79c09a71cf2cf555cde31005d","user":{"login":"daschuer","id":1777442,"avatar_url":"https://avatars.githubusercontent.com/u/1777442?v=3","gravatar_id":"","url":"https://api.github.com/users/daschuer","html_url":"https://github.com/daschuer","followers_url":"https://api.github.com/users/daschuer/followers","following_url":"https://api.github.com/users/daschuer/following{/other_user}","gists_url":"https://api.github.com/users/daschuer/gists{/gist_id}","starred_url":"https://api.github.com/users/daschuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daschuer/subscriptions","organizations_url":"https://api.github.com/users/daschuer/orgs","repos_url":"https://api.github.com/users/daschuer/repos","events_url":"https://api.github.com/users/daschuer/events{/privacy}","received_events_url":"https://api.github.com/users/daschuer/received_events","type":"User","site_admin":false},"body":"Since the m_maxReadableFrameIndex may be changed below, is it line here corrector? \r\nmaybe we can entirely ditch m_maxReadableFrameIndex and use always directly the m_pAudioSource value. ","created_at":"2015-07-27T12:44:01Z","updated_at":"2015-07-27T12:44:01Z","html_url":"https://github.com/mixxxdj/mixxx/pull/652#discussion_r35531074","pull_request_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652","_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/35531074"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/652#discussion_r35531074"},"pull_request":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652"}}},"pull_request":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652","id":40291288,"html_url":"https://github.com/mixxxdj/mixxx/pull/652","diff_url":"https://github.com/mixxxdj/mixxx/pull/652.diff","patch_url":"https://github.com/mixxxdj/mixxx/pull/652.patch","issue_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/652","number":652,"state":"open","locked":false,"title":"CachingReader: Reduce log spam for corrupt files","user":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"body":"Partially fixes (decoding errors at the end of a file): https://bugs.launchpad.net/mixxx/+bug/1470010\r\n* Shorten readable length of corrupt files to avoid repeated decoding\r\n* Code cleanups: Consistent naming, remove unncessary checks and local variables, ...","created_at":"2015-07-18T12:10:10Z","updated_at":"2015-07-27T12:44:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c46963600f8b62a18f20f67e6c3802763b67df1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652/commits","review_comments_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652/comments","review_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/652/comments","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/7c37e39aa2902ad79c09a71cf2cf555cde31005d","head":{"label":"uklotzde:ReduceLogSpamForCorruptFiles","ref":"ReduceLogSpamForCorruptFiles","sha":"7c37e39aa2902ad79c09a71cf2cf555cde31005d","user":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"repo":{"id":11108787,"name":"mixxx","full_name":"uklotzde/mixxx","owner":{"login":"uklotzde","id":1474154,"avatar_url":"https://avatars.githubusercontent.com/u/1474154?v=3","gravatar_id":"","url":"https://api.github.com/users/uklotzde","html_url":"https://github.com/uklotzde","followers_url":"https://api.github.com/users/uklotzde/followers","following_url":"https://api.github.com/users/uklotzde/following{/other_user}","gists_url":"https://api.github.com/users/uklotzde/gists{/gist_id}","starred_url":"https://api.github.com/users/uklotzde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklotzde/subscriptions","organizations_url":"https://api.github.com/users/uklotzde/orgs","repos_url":"https://api.github.com/users/uklotzde/repos","events_url":"https://api.github.com/users/uklotzde/events{/privacy}","received_events_url":"https://api.github.com/users/uklotzde/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uklotzde/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":true,"url":"https://api.github.com/repos/uklotzde/mixxx","forks_url":"https://api.github.com/repos/uklotzde/mixxx/forks","keys_url":"https://api.github.com/repos/uklotzde/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uklotzde/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uklotzde/mixxx/teams","hooks_url":"https://api.github.com/repos/uklotzde/mixxx/hooks","issue_events_url":"https://api.github.com/repos/uklotzde/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/uklotzde/mixxx/events","assignees_url":"https://api.github.com/repos/uklotzde/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/uklotzde/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/uklotzde/mixxx/tags","blobs_url":"https://api.github.com/repos/uklotzde/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uklotzde/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uklotzde/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/uklotzde/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uklotzde/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/uklotzde/mixxx/languages","stargazers_url":"https://api.github.com/repos/uklotzde/mixxx/stargazers","contributors_url":"https://api.github.com/repos/uklotzde/mixxx/contributors","subscribers_url":"https://api.github.com/repos/uklotzde/mixxx/subscribers","subscription_url":"https://api.github.com/repos/uklotzde/mixxx/subscription","commits_url":"https://api.github.com/repos/uklotzde/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/uklotzde/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/uklotzde/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/uklotzde/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/uklotzde/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/uklotzde/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uklotzde/mixxx/merges","archive_url":"https://api.github.com/repos/uklotzde/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uklotzde/mixxx/downloads","issues_url":"https://api.github.com/repos/uklotzde/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/uklotzde/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/uklotzde/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/uklotzde/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uklotzde/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/uklotzde/mixxx/releases{/id}","created_at":"2013-07-01T22:22:18Z","updated_at":"2015-04-15T22:43:12Z","pushed_at":"2015-07-26T22:17:09Z","git_url":"git://github.com/uklotzde/mixxx.git","ssh_url":"git@github.com:uklotzde/mixxx.git","clone_url":"https://github.com/uklotzde/mixxx.git","svn_url":"https://github.com/uklotzde/mixxx","homepage":"http://mixxx.org","size":250274,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mixxxdj:master","ref":"master","sha":"0617f31b3cddf018a88ed5c5b3b4891a4bb00056","user":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"repo":{"id":10126031,"name":"mixxx","full_name":"mixxxdj/mixxx","owner":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixxxdj/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":false,"url":"https://api.github.com/repos/mixxxdj/mixxx","forks_url":"https://api.github.com/repos/mixxxdj/mixxx/forks","keys_url":"https://api.github.com/repos/mixxxdj/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixxxdj/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixxxdj/mixxx/teams","hooks_url":"https://api.github.com/repos/mixxxdj/mixxx/hooks","issue_events_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/mixxxdj/mixxx/events","assignees_url":"https://api.github.com/repos/mixxxdj/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/mixxxdj/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/mixxxdj/mixxx/tags","blobs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixxxdj/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixxxdj/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/mixxxdj/mixxx/languages","stargazers_url":"https://api.github.com/repos/mixxxdj/mixxx/stargazers","contributors_url":"https://api.github.com/repos/mixxxdj/mixxx/contributors","subscribers_url":"https://api.github.com/repos/mixxxdj/mixxx/subscribers","subscription_url":"https://api.github.com/repos/mixxxdj/mixxx/subscription","commits_url":"https://api.github.com/repos/mixxxdj/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixxxdj/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixxxdj/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/mixxxdj/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixxxdj/mixxx/merges","archive_url":"https://api.github.com/repos/mixxxdj/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixxxdj/mixxx/downloads","issues_url":"https://api.github.com/repos/mixxxdj/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/mixxxdj/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/mixxxdj/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixxxdj/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/mixxxdj/mixxx/releases{/id}","created_at":"2013-05-17T15:14:38Z","updated_at":"2015-07-27T02:58:19Z","pushed_at":"2015-07-27T11:30:35Z","git_url":"git://github.com/mixxxdj/mixxx.git","ssh_url":"git@github.com:mixxxdj/mixxx.git","clone_url":"https://github.com/mixxxdj/mixxx.git","svn_url":"https://github.com/mixxxdj/mixxx","homepage":"http://mixxx.org","size":327407,"stargazers_count":333,"watchers_count":333,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":226,"mirror_url":null,"open_issues_count":60,"forks":226,"open_issues":60,"watchers":333,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/652"},"issue":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/652"},"comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/652/comments"},"review_comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652/comments"},"review_comment":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/652/commits"},"statuses":{"href":"https://api.github.com/repos/mixxxdj/mixxx/statuses/7c37e39aa2902ad79c09a71cf2cf555cde31005d"}}}}