Changeset 2e1cf451fa5cca785451c97aaea55fd4f7e14d95

Show
Ignore:
Timestamp:
07/09/04 11:34:03 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1094549643 +0000
git-parent:

[f9701bc54aa3779d0188761f26f5bb507b1692e3]

git-author:
Gildas Bazin <gbazin@videolan.org> 1094549643 +0000
Message:

* src/input/decoder.c, modules/codec/faad.c: work around another bug in libfaad with ADTS streams.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/faad.c

    r779340c r2e1cf45  
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    8  *          Gildas Bazin <gbazin@netcourrier.com
     8 *          Gildas Bazin <gbazin@videolan.org
    99 * 
    1010 * This program is free software; you can redistribute it and/or modify 
     
    201201    } 
    202202 
     203    if( p_dec->fmt_out.audio.i_rate == 0 && p_dec->fmt_in.i_extra > 0 ) 
     204    { 
     205        /* We have a decoder config so init the handle */ 
     206        unsigned long i_rate; 
     207        unsigned char i_channels; 
     208 
     209        if( faacDecInit2( p_sys->hfaad, p_dec->fmt_in.p_extra, 
     210                          p_dec->fmt_in.i_extra, 
     211                          &i_rate, &i_channels ) >= 0 ) 
     212        { 
     213            p_dec->fmt_out.audio.i_rate = i_rate; 
     214            p_dec->fmt_out.audio.i_channels = i_channels; 
     215            aout_DateInit( &p_sys->date, i_rate ); 
     216        } 
     217    } 
     218 
    203219    if( p_dec->fmt_out.audio.i_rate == 0 && p_sys->i_buffer ) 
    204220    { 
     
    308324                    break; 
    309325                } 
     326            } 
     327 
     328            if( j == MAX_CHANNEL_POSITIONS ) 
     329            { 
     330                msg_Warn( p_dec, "unknow channel ordering" ); 
     331                block_Release( p_block ); 
     332                return NULL; 
    310333            } 
    311334        } 
  • src/input/decoder.c

    r8ca6f29 r2e1cf45  
    590590                    p_packetizer->pf_packetize( p_packetizer, &p_block )) ) 
    591591            { 
     592                if( p_packetizer->fmt_out.i_extra && !p_dec->fmt_in.i_extra ) 
     593                { 
     594                    p_dec->fmt_in.i_extra = p_packetizer->fmt_out.i_extra; 
     595                    p_dec->fmt_in.p_extra = malloc( p_dec->fmt_in.i_extra ); 
     596                    memcpy( p_dec->fmt_in.p_extra, 
     597                            p_packetizer->fmt_out.p_extra, 
     598                            p_dec->fmt_in.i_extra ); 
     599                } 
     600 
    592601                while( p_packetized_block ) 
    593602                {