Diff between 3e23bec36539f9c42a575577d9e973ec01a7461e and 5dab4aaafaeff8d3a71e8e03eecbe62392075d19

Changed Files

File Additions Deletions Status
android/hal-audio.c +6 -2 modified

Full Patch

diff --git a/android/hal-audio.c b/android/hal-audio.c
index 534620a..9807a5d 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -691,8 +691,12 @@ static bool write_data(struct a2dp_stream_out *out, const void *buffer,
 			}
 		}
 
-		/* in resync mode we'll just drop mediapackets */
-		if (!ep->resync) {
+		/* we send data only in case codec encoded some data, i.e. some
+		 * codecs do internal buffering and output data only if full
+		 * frame can be encoded
+		 * in resync mode we'll just drop mediapackets
+		 */
+		if (written > 0 && !ep->resync) {
 			/* wait some time for socket to be ready for write,
 			 * but we'll just skip writing data if timeout occurs
 			 */