mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Fix generation of IEC958 subframes
From: Nicolas Boullis <nboullis@debian.org> While working on an ALSA driver for the audio part of em8300-based MPEG decoder boards (Sigma Designs' Hollywood+ boards and Creative Labs' DXR3 boards), I think I discovered a bug in the code that generates IEC958 subframes from linear samples (iec958 plugin): M and W preambles are swapped, and B preambles should only be used on even subframes. The attached patch fixes this issue.
This commit is contained in:
		
							parent
							
								
									367c3fc6ce
								
							
						
					
					
						commit
						6b85e23fa3
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -116,10 +116,10 @@ static inline u_int32_t iec958_subframe(snd_pcm_iec958_t *iec, u_int32_t data, i
 | 
				
			||||||
		data |= 0x80000000;
 | 
							data |= 0x80000000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Preamble */
 | 
						/* Preamble */
 | 
				
			||||||
	if (! iec->counter)
 | 
						if (channel)
 | 
				
			||||||
		data |= iec->preamble[PREAMBLE_Z];	/* Block start, 'Z' */
 | 
					 | 
				
			||||||
	else if (! channel)
 | 
					 | 
				
			||||||
		data |= iec->preamble[PREAMBLE_Y];	/* odd sub frame, 'Y' */
 | 
							data |= iec->preamble[PREAMBLE_Y];	/* odd sub frame, 'Y' */
 | 
				
			||||||
 | 
						else if (! iec->counter)
 | 
				
			||||||
 | 
							data |= iec->preamble[PREAMBLE_Z];	/* Block start, 'Z' */
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		data |= iec->preamble[PREAMBLE_X];	/* even sub frame, 'X' */
 | 
							data |= iec->preamble[PREAMBLE_X];	/* even sub frame, 'X' */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue