Skip to content

Commit ae0ff05

Browse files
committed
Merge branch 'bugfix/esp_rtc_example_no_audio' into 'master'
Bugfix/esp rtc example no audio See merge request adf/esp-adf-internal!1329
2 parents 536c989 + 41f94ef commit ae0ff05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: examples/protocols/components/av_stream/av_stream_hal/av_stream_hal_audio.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ int av_stream_audio_read(char *buf, int len, TickType_t wait_time, bool uac_en)
151151
return ret;
152152
} else {
153153
ret = audio_element_input(i2s_io_reader, buf, len);
154-
if (ret < 0) {
155-
ESP_LOGE(TAG, "i2s read failed");
154+
if (ret <= 0) {
155+
ESP_LOGE(TAG, "i2s fail read ret %d", ret);
156+
return ret;
156157
}
157158
#if (CONFIG_IDF_TARGET_ESP32 && !RECORD_HARDWARE_AEC)
158159
algorithm_mono_fix((uint8_t *)buf, bytes_read);
159160
#endif
161+
bytes_read = ret;
160162
}
161163

162164
return bytes_read;

0 commit comments

Comments
 (0)