dca: set AVCodecContext frame_size for DTS audio
Set the frame size when decoding DTS audio. This has the side effect of fixing the computation of timestamps for DTS-HD in compute_pkt_fields. Since frame_size is not currently set, the duration of a frame is being guessed based on the streams bitrate. But for DTS-HD, the bitrate currently used is the rate of the DTS core which is much different than the whole DTS-HD stream and leads to a wildly inaccurate frame duration estimate. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit49c7006c7e) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit0631896885) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
		 John Stebbins
					John Stebbins
				
			
				
					committed by
					
						 Reinhard Tartler
						Reinhard Tartler
					
				
			
			
				
	
			
			
			 Reinhard Tartler
						Reinhard Tartler
					
				
			
						parent
						
							572e94bc51
						
					
				
				
					commit
					84fce203bd
				
			| @@ -1224,6 +1224,7 @@ static int dca_decode_frame(AVCodecContext * avctx, | |||||||
|     //set AVCodec values with parsed data |     //set AVCodec values with parsed data | ||||||
|     avctx->sample_rate = s->sample_rate; |     avctx->sample_rate = s->sample_rate; | ||||||
|     avctx->bit_rate = s->bit_rate; |     avctx->bit_rate = s->bit_rate; | ||||||
|  |     avctx->frame_size = s->sample_blocks * 32; | ||||||
|  |  | ||||||
|     channels = s->prim_channels + !!s->lfe; |     channels = s->prim_channels + !!s->lfe; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user