Revision 0e09997f libavcodec/dca.c

View differences:

libavcodec/dca.c
1626 1626
    int lfe_samples;
1627 1627
    int num_core_channels = 0;
1628 1628
    int i;
1629
    /* ffdshow custom code */
1630
#if CONFIG_AUDIO_FLOAT
1631
    float *samples = data;
1632
#else
1629 1633
    int16_t *samples = data;
1634
#endif
1630 1635
    DCAContext *s = avctx->priv_data;
1631 1636
    int channels;
1632 1637
    int core_ss_end;
......
1812 1817
        return -1;
1813 1818
    }
1814 1819

  
1815
    if (*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)
1820
    /* ffdshow custom code */
1821
    if (*data_size < (s->sample_blocks / 8) * 256 * sizeof(samples[0]) * channels)
1816 1822
        return -1;
1817
    *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels;
1823
    *data_size = 256 / 8 * s->sample_blocks * sizeof(samples[0]) * channels;
1818 1824

  
1819 1825
    /* filter to get final output */
1820 1826
    for (i = 0; i < (s->sample_blocks / 8); i++) {
......
1833 1839
            }
1834 1840
        }
1835 1841

  
1842
        /* interleave samples */
1843
#if CONFIG_AUDIO_FLOAT
1844
        /* ffdshow custom code */
1845
        float_interleave(samples, s->samples_chanptr, 256, channels);
1846
#else
1836 1847
        s->fmt_conv.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels);
1848
#endif
1837 1849
        samples += 256 * channels;
1838 1850
    }
1839 1851

  
......
1870 1882

  
1871 1883
    for (i = 0; i < DCA_PRIM_CHANNELS_MAX+1; i++)
1872 1884
        s->samples_chanptr[i] = s->samples + i * 256;
1885
    /* ffdshow custom code */
1886
#if CONFIG_AUDIO_FLOAT
1887
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
1888
#else
1873 1889
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1890
#endif
1874 1891

  
1875 1892
    s->scale_bias = 1.0;
1876 1893

  

Also available in: Unified diff