{"action":"opened","issue":{"url":"https://api.github.com/repos/fyhertz/libstreaming/issues/148","labels_url":"https://api.github.com/repos/fyhertz/libstreaming/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/fyhertz/libstreaming/issues/148/comments","events_url":"https://api.github.com/repos/fyhertz/libstreaming/issues/148/events","html_url":"https://github.com/fyhertz/libstreaming/issues/148","id":112980600,"number":148,"title":"streaming.gl.SurfaceView: waiting time for new frame too long?","user":{"login":"t-benze","id":4394426,"avatar_url":"https://avatars.githubusercontent.com/u/4394426?v=3","gravatar_id":"","url":"https://api.github.com/users/t-benze","html_url":"https://github.com/t-benze","followers_url":"https://api.github.com/users/t-benze/followers","following_url":"https://api.github.com/users/t-benze/following{/other_user}","gists_url":"https://api.github.com/users/t-benze/gists{/gist_id}","starred_url":"https://api.github.com/users/t-benze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-benze/subscriptions","organizations_url":"https://api.github.com/users/t-benze/orgs","repos_url":"https://api.github.com/users/t-benze/repos","events_url":"https://api.github.com/users/t-benze/events{/privacy}","received_events_url":"https://api.github.com/users/t-benze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-23T08:58:01Z","updated_at":"2015-10-23T08:58:01Z","closed_at":null,"body":"In class streaming.gl.SurfaceView, the waiting time for synchronisation here is set to 2500 ms, ideally this should be fine as new frames keep coming in and notifying mSyncObject. However, in my testing, sometimes it will really wait for 2500ms and causes the preview to freeze. Changing the waiting time to a smaller value (e.g. 100) will fix the problem. But I'm not sure why this is happening, can anyone give some reasoning about it?\r\n    \r\n    @Override\r\n    public void run() {\r\n    while (mRunning) {\r\n      synchronized (mSyncObject) {\r\n      mSyncObject.wait(2500);\r\n      if (mFrameAvailable) {\r\n      ....\r\n      }\r\n    }\r\n                        "}}