~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/ws-snd1.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Andrew Starr-Bochicchio, Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081226001006-2040ls9680bd1blt
Tags: 1.1.7-0.2ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian-multimedia (LP: #298547), Ubuntu Changes:
 - For ffmpeg-related build-deps, fix versionized dependencies
   as the ubuntu versioning is different than debian-multimedia's.

[ Lionel Le Folgoc ]
* LP: #311412 is fixed since the 1.1.7~rc1-0.1 revision.
* debian/patches/03_ffmpeg.diff: updated to fix FTBFS due to libswscale API
  change (cherry-pick from Gentoo #234383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
#define CLIP8(a) if(a>127)a=127;if(a<-128)a=-128;
38
38
 
39
 
static int ws_snd_decode_init(AVCodecContext * avctx)
 
39
static av_cold int ws_snd_decode_init(AVCodecContext * avctx)
40
40
{
41
41
//    WSSNDContext *c = avctx->priv_data;
42
42
 
45
45
 
46
46
static int ws_snd_decode_frame(AVCodecContext *avctx,
47
47
                void *data, int *data_size,
48
 
                uint8_t *buf, int buf_size)
 
48
                const uint8_t *buf, int buf_size)
49
49
{
50
50
//    WSSNDContext *c = avctx->priv_data;
51
51
 
62
62
    in_size = AV_RL16(&buf[2]);
63
63
    buf += 4;
64
64
 
 
65
    if (out_size > *data_size) {
 
66
        av_log(avctx, AV_LOG_ERROR, "Frame is too large to fit in buffer\n");
 
67
        return -1;
 
68
    }
 
69
    if (in_size > buf_size) {
 
70
        av_log(avctx, AV_LOG_ERROR, "Frame data is larger than input buffer\n");
 
71
        return -1;
 
72
    }
65
73
    if (in_size == out_size) {
66
74
        for (i = 0; i < out_size; i++)
67
75
            *samples++ = (*buf++ - 0x80) << 8;
141
149
    NULL,
142
150
    NULL,
143
151
    ws_snd_decode_frame,
 
152
    .long_name = "Westwood Audio (SND1)",
144
153
};