Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adc37566 authored by Naresh Tanniru's avatar Naresh Tanniru
Browse files

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
parent 3b58780a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);