{"action":"opened","issue":{"url":"https://api.github.com/repos/sashahilton00/spotify-connect-resources/issues/3","repository_url":"https://api.github.com/repos/sashahilton00/spotify-connect-resources","labels_url":"https://api.github.com/repos/sashahilton00/spotify-connect-resources/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/sashahilton00/spotify-connect-resources/issues/3/comments","events_url":"https://api.github.com/repos/sashahilton00/spotify-connect-resources/issues/3/events","html_url":"https://github.com/sashahilton00/spotify-connect-resources/issues/3","id":140381200,"number":3,"title":"playback_data_callback","user":{"login":"tokazio","id":7676865,"avatar_url":"https://avatars.githubusercontent.com/u/7676865?v=3","gravatar_id":"","url":"https://api.github.com/users/tokazio","html_url":"https://github.com/tokazio","followers_url":"https://api.github.com/users/tokazio/followers","following_url":"https://api.github.com/users/tokazio/following{/other_user}","gists_url":"https://api.github.com/users/tokazio/gists{/gist_id}","starred_url":"https://api.github.com/users/tokazio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tokazio/subscriptions","organizations_url":"https://api.github.com/users/tokazio/orgs","repos_url":"https://api.github.com/users/tokazio/repos","events_url":"https://api.github.com/users/tokazio/events{/privacy}","received_events_url":"https://api.github.com/users/tokazio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-12T12:53:20Z","updated_at":"2016-03-12T12:53:20Z","closed_at":null,"body":"Can't get the userdata pointer back in the playback_data callback.\r\nWorking in C++, based on [this C code](https://github.com/wouterdevinck/clonos-poc-spotify)\r\n\r\n`void SpotifyConnect::playback_data(const void *frames, uint32_t num_frames, sp_audioformat *format, void *userdata) {\r\n//getting the void* userdata to the SpotifyConnect object\r\n        SpotifyConnect* spoti = (SpotifyConnect*) userdata;\r\n//trying to get the device name stored in the SpotifyConnect object\r\n        std::cout<<\"DATA Device name:\" << spoti->getDeviceName()<<std::endl;\r\n//this return ' VX?gO??4(ESG??? ' and quit        \r\n}\r\n`\r\n\r\nCallback is registered at start by:\r\n`\r\nSpRegisterPlaybackCallbacks(&playback_cb,this);\r\n`\r\n\r\nBy passing the 'this' pointer as 'userdata'.\r\n\r\nNo problem in others callbacks (playback_notify)...\r\nI'm beginner in C++ but i don't understand why it's working in other callbacks and not in the 'data' callback."}}