Skip to content

Commit

Permalink
Catch errors
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information
felipec committed Oct 2, 2010
1 parent 458f8cd commit 719e87d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gstavdec.c
Expand Up @@ -190,6 +190,10 @@ pad_chain(GstPad *pad, GstBuffer *buf)
buffer_data = self->buffer_data + self->ring.in;
buffer_size = self->buffer_size - self->ring.in;
read = avcodec_decode_audio3(self->av_ctx, buffer_data, &buffer_size, &pkt);
if (read < 0) {
ret = GST_FLOW_ERROR;
break;
}

self->ring.in += buffer_size;
if (self->ring.in >= 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE) {
Expand Down

0 comments on commit 719e87d

Please sign in to comment.