diff --git a/spotifyblob/blob/spotifyclient.cpp b/spotifyblob/blob/spotifyclient.cpp index dfebe6c41..0b0e27410 100644 --- a/spotifyblob/blob/spotifyclient.cpp +++ b/spotifyblob/blob/spotifyclient.cpp @@ -679,6 +679,11 @@ int SpotifyClient::MusicDeliveryCallback( me->byte_rate_ = byte_rate; } +#ifdef Q_OS_DARWIN + // For some reason, the data doesn't reliably get pushed to the underlying socket on Mac. + me->media_socket_->flush(); +#endif + if (me->media_socket_->bytesToWrite() >= 8192) { return 0; } @@ -688,11 +693,6 @@ int SpotifyClient::MusicDeliveryCallback( reinterpret_cast(frames), num_frames * format->channels * 2); -#ifdef Q_OS_DARWIN - // ??? - me->media_socket_->flush(); -#endif - return bytes_written / (format->channels * 2); }