aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2005-12-09 16:08:18 +0000
committerRoberto Togni <r_togni@tiscali.it>2005-12-09 16:08:18 +0000
commite0f7e3297073e341b43522d67ad717a3d568cd3c (patch)
tree4251f14d6f4e6dfa54f6b0fb73fc9c4a81cdb4e9 /libavcodec/ra288.c
parent60d76256cb6abb7a5f65e434031d0ebb114599ea (diff)
downloadffmpeg-e0f7e3297073e341b43522d67ad717a3d568cd3c.tar.gz
Cook compatibe decoder, patch by Benjamin Larsson
Add cook demucing, change rm demuxer so that it reorders audio packets before sending them to the decoder, and send minimum decodeable sized packets; pass only real codec extradata fo the decoder Fix 28_8 decoder for the new demuxer strategy Originally committed as revision 4726 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 4cff3106e5..9082920346 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -228,41 +228,19 @@ static int ra288_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
uint8_t * buf, int buf_size)
{
- if(avctx->extradata_size>=6)
- {
-//((short*)(avctx->extradata))[0]; /* subpacket size */
-//((short*)(avctx->extradata))[1]; /* subpacket height */
-//((short*)(avctx->extradata))[2]; /* subpacket flavour */
-//((short*)(avctx->extradata))[3]; /* coded frame size */
-//((short*)(avctx->extradata))[4]; /* codec's data length */
-//((short*)(avctx->extradata))[5...] /* codec's data */
- int bret;
void *datao;
- int w=avctx->block_align; /* 228 */
- int h=((short*)(avctx->extradata))[1]; /* 12 */
- int cfs=((short*)(avctx->extradata))[3]; /* coded frame size 38 */
- int i,j;
- if(buf_size<w*h)
+
+ if (buf_size < avctx->block_align)
{
- av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,w*h);
+ av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,avctx->block_align);
return 0;
}
+
datao = data;
- bret = 0;
- for (j = 0; j < h/2; j++)
- for (i = 0; i < h; i++)
- {
- data=decode_block(avctx,&buf[j*cfs+cfs*i*h/2],(signed short *)data,cfs);
- bret += cfs;
- }
+ data = decode_block(avctx, buf, (signed short *)data, avctx->block_align);
+
*data_size = (char *)data - (char *)datao;
- return bret;
- }
- else
- {
- av_log(avctx, AV_LOG_ERROR, "ffra288: Error: need extra data!!!\n");
- return 0;
- }
+ return avctx->block_align;
}
AVCodec ra_288_decoder =