Ticket #250: 0001-Fix-mis-calculation-of-orig_samplesize.patch

File 0001-Fix-mis-calculation-of-orig_samplesize.patch, 956 bytes (added by KO Myung-Hun, 3 days ago)
  • lib/unipcm.c

    From 1cd468f48d2728bf2dfc6fad7d19fc5ac9c6e359 Mon Sep 17 00:00:00 2001
    From: KO Myung-Hun <komh78@gmail.com>
    Date: Fri, 31 Jan 2025 21:40:27 +0900
    Subject: [PATCH] Fix mis-calculation of orig_samplesize
    
    orig_samplesize should be calculated from pcm->orig_format not
    pcm->format.
    ---
     lib/unipcm.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/lib/unipcm.c b/lib/unipcm.c
    index 8d0081f..fa71f53 100644
    a b int _uniaud_pcm_write(uniaud_pcm *pcm, char* buffer, int size)  
    655655                        }
    656656                }
    657657#endif
    658                 orig_samplesize = uniaud_pcm_format_size(pcm->format, 1) * pcm->orig_channels;
     658                orig_samplesize = uniaud_pcm_format_size(pcm->orig_format, 1) * pcm->orig_channels;
    659659                samplesize = uniaud_pcm_format_size(pcm->format, 1) * pcm->channels;
    660660                if (pcm->resample_size == 0) {
    661661                        //printf("format: %i, orig format: %i chans: %i, ssize: %i\n",pcm->format, pcm->orig_format,