qahw: Add condition to check bytes written to hal

- playback is not stopped even bytes written is < 0.
- Add condition to check bytes written and exit playback if
 bytes written is < 0.

Change-Id: Id80c05f324b36e47a733ac441934bde115502ce2
This commit is contained in:
Naresh Tanniru 2017-03-10 19:48:12 +05:30
parent 3b58780aa7
commit adc3756641
1 changed files with 4 additions and 0 deletions

View File

@ -739,6 +739,10 @@ void *start_stream_playback (void* stream_data)
fprintf(log_file, "stream %d: writing to hal %zd bytes, offset %d, write length %zd\n",
params->stream_index, bytes_remaining, offset, write_length);
bytes_written = write_to_hal(params->out_handle, data_ptr+offset, bytes_remaining, params);
if (bytes_written == -1) {
fprintf(stderr, "proxy_write failed in usb hal");
break;
}
bytes_remaining -= bytes_written;
latency = qahw_out_get_latency(params->out_handle);