Handle IPTV tuning read error

bytes_read will be -1 if recv_from() fails to capture data from
the udp socket.

Bug: 288170590
Test: atest VtsHalTvTunerTargetTest
Change-Id: I7f3c4789d2631c5add8dff778e2155b7e95a3ffc
This commit is contained in:
sadiqsada
2023-11-07 16:02:41 -08:00
committed by Sadiq Sada
parent 028f27618d
commit 94eddcf3ce

View File

@@ -215,7 +215,7 @@ Frontend::~Frontend() {
void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) {
ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms);
if (bytes_read == 0) {
if (bytes_read <= 0) {
ALOGI("[ ERROR ] Tune byte couldn't be read.");
return;
}