Changeset 7b087611c2486e4a76e3bb9f380a36880e713bc0

Show
Ignore:
Timestamp:
12/30/07 05:25:04 (6 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1198988704 +0000
git-parent:

[1b26ff77b0fd9ea5d713c7acd52259e6c68efbf5]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1198988704 +0000
Message:

audio_filter/converter/dtstospdif.c: Fix odd frame sized DTS conversion to SPDIF. Patch by Julien Robert <jul at mac.com>. (Reported to fix most of the current DTS issues).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • THANKS

    rf5a08fa r7b08761  
    123123Julien Blache <jb at technologeek.org> - disc ejection code 
    124124Julien Plissonneau Duquène - JACK audio input module  
     125Julien Robert <jul at mac.com> - DTS to SPDIF fixes. 
    125126Kang Jeong-Hee <keizie at gmail dot com> - Korean translation 
    126127Kenneth Ostby <kenneo -at- idi -dot- ntnu -dot- no> - Audioscrobbler plugin 
  • modules/audio_filter/converter/dtstospdif.c

    r3163d13 r7b08761  
    157157    for( i_frame = 0; i_frame < 3; i_frame++ ) 
    158158    { 
     159        uint16_t i_length_padded = i_length; 
    159160        byte_t * p_out = p_out_buf->p_buffer + (i_frame * i_fz); 
    160161        byte_t * p_in = p_filter->p_sys->p_buf + (i_frame * i_length); 
     
    171172        { 
    172173            p_filter->p_libvlc->pf_memcpy( p_out, p_sync_be, 6 ); 
    173             p_out[5] = i_ac5_spdif_type; 
     174            p_out[4] = i_ac5_spdif_type; 
    174175            p_out[6] = (( i_length ) >> 5 ) & 0xFF; 
    175176            p_out[7] = ( i_length << 3 ) & 0xFF; 
     
    203204            } 
    204205#endif 
     206            /* If i_length is odd, we have to adjust swapping a bit.. */ 
     207            if( i_length & 1 ) 
     208            { 
     209                p_out[8+i_length-1] = 0; 
     210                p_out[8+i_length] = p_in[i_length-1]; 
     211                i_length_padded++; 
     212            } 
    205213        } 
    206214        else 
     
    211219        if( i_fz > i_length + 8 ) 
    212220        { 
    213             p_filter->p_libvlc->pf_memset( p_out + 8 + i_length, 0, 
    214                                         i_fz - i_length - 8 ); 
     221            p_filter->p_libvlc->pf_memset( p_out + 8 + i_length_padded, 0, 
     222                                        i_fz - i_length_padded - 8 ); 
    215223        } 
    216224    }