Revision 9c8f0768 libavcodec/libvorbis.c

View differences:

libavcodec/libvorbis.c
42 42
    vorbis_block vb ;
43 43
    uint8_t buffer[BUFFER_SIZE];
44 44
    int buffer_index;
45
    int eof;
45 46

  
46 47
    /* decoder */
47 48
    vorbis_comment vc ;
......
136 137
                           int buf_size, void *data)
137 138
{
138 139
    OggVorbisContext *context = avccontext->priv_data ;
139
    float **buffer ;
140 140
    ogg_packet op ;
141 141
    signed short *audio = data ;
142
    int l, samples = data ? OGGVORBIS_FRAME_SIZE : 0;
142
    int l;
143

  
144
    if(data) {
145
        int samples = OGGVORBIS_FRAME_SIZE;
146
        float **buffer ;
143 147

  
144 148
    buffer = vorbis_analysis_buffer(&context->vd, samples) ;
145 149

  
......
154 158
    }
155 159

  
156 160
    vorbis_analysis_wrote(&context->vd, samples) ;
161
    } else {
162
        if(!context->eof)
163
            vorbis_analysis_wrote(&context->vd, 0) ;
164
        context->eof = 1;
165
    }
157 166

  
158 167
    while(vorbis_analysis_blockout(&context->vd, &context->vb) == 1) {
159 168
        vorbis_analysis(&context->vb, NULL);

Also available in: Unified diff