~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to quicktime/ffmpeg/libavcodec/cscd.c

  • Committer: Paolo Rampino
  • Date: 2010-03-06 18:08:30 UTC
  • Revision ID: git-v1:9d525e02347cedf5c7cbe9ecbf5d50b83c26f5e4
Updated ffmpeg, now open also flv with aac codecs

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "avcodec.h"
25
25
 
26
 
#ifdef CONFIG_ZLIB
 
26
#if CONFIG_ZLIB
27
27
#include <zlib.h>
28
28
#endif
29
29
#include "libavutil/lzo.h"
158
158
    switch ((buf[0] >> 1) & 7) {
159
159
        case 0: { // lzo compression
160
160
            int outlen = c->decomp_size, inlen = buf_size - 2;
161
 
            if (lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen))
 
161
            if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen))
162
162
                av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
163
163
            break;
164
164
        }
165
165
        case 1: { // zlib compression
166
 
#ifdef CONFIG_ZLIB
 
166
#if CONFIG_ZLIB
167
167
            unsigned long dlen = c->decomp_size;
168
168
            if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK)
169
169
                av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
217
217
    if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
218
218
        return 1;
219
219
    }
220
 
    switch (avctx->bits_per_sample) {
 
220
    switch (avctx->bits_per_coded_sample) {
221
221
        case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
222
222
        case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
223
223
        case 32: avctx->pix_fmt = PIX_FMT_RGB32; break;
224
224
        default:
225
225
            av_log(avctx, AV_LOG_ERROR,
226
226
                   "CamStudio codec error: invalid depth %i bpp\n",
227
 
                   avctx->bits_per_sample);
 
227
                   avctx->bits_per_coded_sample);
228
228
             return 1;
229
229
    }
230
 
    c->bpp = avctx->bits_per_sample;
 
230
    c->bpp = avctx->bits_per_coded_sample;
231
231
    c->pic.data[0] = NULL;
232
 
    c->linelen = avctx->width * avctx->bits_per_sample / 8;
 
232
    c->linelen = avctx->width * avctx->bits_per_coded_sample / 8;
233
233
    c->height = avctx->height;
234
234
    c->decomp_size = c->height * c->linelen;
235
 
    c->decomp_buf = av_malloc(c->decomp_size + LZO_OUTPUT_PADDING);
 
235
    c->decomp_buf = av_malloc(c->decomp_size + AV_LZO_OUTPUT_PADDING);
236
236
    if (!c->decomp_buf) {
237
237
        av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
238
238
        return 1;
258
258
    decode_end,
259
259
    decode_frame,
260
260
    CODEC_CAP_DR1,
261
 
    .long_name = "CamStudio",
 
261
    .long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
262
262
};
263
263