mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-10-29 05:40:23 -04:00 
			
		
		
		
	bluetooth: Don't abort on SBC decoding error
The Nokia E7 running Symbian Belle Refresh seems to generate invalid SBC packets every few minutes. This causes pulseaudio to disconnect the stream and log "SBC decoding error (-3)". If a single packet is bad, pulseaudio should keep playing the stream.
This commit is contained in:
		
							parent
							
								
									f46799579f
								
							
						
					
					
						commit
						4a5f48e7a4
					
				
					 2 changed files with 14 additions and 10 deletions
				
			
		|  | @ -937,7 +937,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 0; | ||||
|             } | ||||
| 
 | ||||
| /*             pa_log_debug("SBC: decoded: %lu; written: %lu", (unsigned long) decoded, (unsigned long) written); */ | ||||
|  | @ -1039,12 +1039,14 @@ static void thread_func(void *userdata) { | |||
|                 if (n_read < 0) | ||||
|                     goto io_fail; | ||||
| 
 | ||||
|                 if (n_read > 0) { | ||||
|                     /* We just read something, so we are supposed to write something, too */ | ||||
|                     pending_read_bytes += n_read; | ||||
|                     do_write += pending_read_bytes / u->write_block_size; | ||||
|                     pending_read_bytes = pending_read_bytes % u->write_block_size; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state)) { | ||||
| 
 | ||||
|  |  | |||
|  | @ -458,7 +458,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 0; | ||||
|             } | ||||
| 
 | ||||
|             /* Reset frame length, it can be changed due to bitpool change */ | ||||
|  | @ -1095,12 +1095,14 @@ static void thread_func(void *userdata) { | |||
|                 if (n_read < 0) | ||||
|                     goto io_fail; | ||||
| 
 | ||||
|                 if (n_read > 0) { | ||||
|                     /* We just read something, so we are supposed to write something, too */ | ||||
|                     pending_read_bytes += n_read; | ||||
|                     do_write += pending_read_bytes / u->write_block_size; | ||||
|                     pending_read_bytes = pending_read_bytes % u->write_block_size; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state)) { | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 James Bunton
						James Bunton