---
Letting my phone play music all night I noticed it was gone in the morning because a crc error occurred. I don't think it should be as fatal as it currently is, so just try our luck again on next frame instead of stopping decode entirely.
>From 0d3062e988c9a4f01b5bf38a48a90a685cf97078 Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <m.b.lankho...@gmail.com>
Date: Fri, 4 Mar 2011 14:43:58 +0100
Subject: [PATCH 2/2] bluetooth: Do not stop decoding because of a crc error

---
 src/modules/bluetooth/module-bluetooth-device.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c 
b/src/modules/bluetooth/module-bluetooth-device.c
index 6a33ef0..fad8e45 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1457,7 +1457,7 @@ static int a2dp_process_push(struct userdata *u) {
                 pa_log_error("SBC decoding error (%li)", (long) decoded);
                 pa_memblock_release(memchunk.memblock);
                 pa_memblock_unref(memchunk.memblock);
-                return -1;
+                return decoded < 0 ? decoded : -1;
             }
 
 /*             pa_log_debug("SBC: decoded: %lu; written: %lu", (unsigned long) 
decoded, (unsigned long) written); */
@@ -1535,7 +1535,10 @@ static void thread_func(void *userdata) {
                 else
                     n_read = a2dp_process_push(u);
 
-                if (n_read < 0)
+                if (n_read == -3)
+                    /* CRC error */
+                    n_read = 0;
+                else if (n_read < 0)
                     goto fail;
 
                 /* We just read something, so we are supposed to write 
something, too */
-- 
1.7.2.3

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

Reply via email to