Revision 813dbb44 libavdevice/alsa-audio-enc.c

View differences:

libavdevice/alsa-audio-enc.c
76 76
    int size     = pkt->size;
77 77
    uint8_t *buf = pkt->data;
78 78

  
79
    while((res = snd_pcm_writei(s->h, buf, size / s->frame_size)) < 0) {
79
    size /= s->frame_size;
80
    if (s->reorder_func) {
81
        if (size > s->reorder_buf_size)
82
            if (ff_alsa_extend_reorder_buf(s, size))
83
                return AVERROR(ENOMEM);
84
        s->reorder_func(buf, s->reorder_buf, size);
85
        buf = s->reorder_buf;
86
    }
87
    while ((res = snd_pcm_writei(s->h, buf, size)) < 0) {
80 88
        if (res == -EAGAIN) {
81 89

  
82 90
            return AVERROR(EAGAIN);

Also available in: Unified diff