Mercurial > libavcodec.hg
comparison mpegaudiodec.c @ 6689:85cb0c3f8e54 libavcodec
simplify using FFMIN3
author | bcoudurier |
---|---|
date | Sat, 26 Apr 2008 12:51:52 +0000 |
parents | 91f5a23d6cd5 |
children | 36e1f34d5428 |
comparison
equal
deleted
inserted
replaced
6688:91f5a23d6cd5 | 6689:85cb0c3f8e54 |
---|---|
2579 outptr = s->frames == 1 ? out_samples : decoded_buf; | 2579 outptr = s->frames == 1 ? out_samples : decoded_buf; |
2580 | 2580 |
2581 for (fr = 0; fr < s->frames; fr++) { | 2581 for (fr = 0; fr < s->frames; fr++) { |
2582 start = start2; | 2582 start = start2; |
2583 fsize = (start[0] << 4) | (start[1] >> 4); | 2583 fsize = (start[0] << 4) | (start[1] >> 4); |
2584 fsize = FFMIN3(fsize, len, MPA_MAX_CODED_FRAME_SIZE); | |
2584 start2 += fsize; | 2585 start2 += fsize; |
2585 if (fsize > len) | |
2586 fsize = len; | |
2587 len -= fsize; | 2586 len -= fsize; |
2588 if (fsize > MPA_MAX_CODED_FRAME_SIZE) | |
2589 fsize = MPA_MAX_CODED_FRAME_SIZE; | |
2590 m = s->mp3decctx[fr]; | 2587 m = s->mp3decctx[fr]; |
2591 assert (m != NULL); | 2588 assert (m != NULL); |
2592 | 2589 |
2593 // Get header | 2590 // Get header |
2594 header = AV_RB32(start) | 0xfff00000; | 2591 header = AV_RB32(start) | 0xfff00000; |