Revision 3fdb6af9

View differences:

libavformat/utils.c
1750 1750
{
1751 1751
    int16_t *samples;
1752 1752
    AVCodec *codec;
1753
    int got_picture, ret=0;
1753
    int got_picture, data_size, ret=0;
1754 1754
    AVFrame picture;
1755 1755

  
1756 1756
  if(!st->codec->codec){
......
1769 1769
                                   &got_picture, (uint8_t *)data, size);
1770 1770
        break;
1771 1771
    case CODEC_TYPE_AUDIO:
1772
        samples = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
1772
        data_size = FFMAX(size, AVCODEC_MAX_AUDIO_FRAME_SIZE);
1773
        samples = av_malloc(data_size);
1773 1774
        if (!samples)
1774 1775
            goto fail;
1775
        ret = avcodec_decode_audio(st->codec, samples,
1776
                                   &got_picture, (uint8_t *)data, size);
1776
        ret = avcodec_decode_audio2(st->codec, samples,
1777
                                    &data_size, (uint8_t *)data, size);
1777 1778
        av_free(samples);
1778 1779
        break;
1779 1780
    default:

Also available in: Unified diff