View | Details | Raw Unified
Collapse All | Expand All

(-)a/libavcodec/dtsdec.c (-7 / +8 lines)
 Lines 36-41   typedef struct DTSContext { Link Here 
36
    uint8_t buf[BUFFER_SIZE];
36
    uint8_t buf[BUFFER_SIZE];
37
    uint8_t *bufptr;
37
    uint8_t *bufptr;
38
    uint8_t *bufpos;
38
    uint8_t *bufpos;
39
    int flags;
40
    int sample_rate;
41
    int bit_rate;
39
} DTSContext;
42
} DTSContext;
40
43
41
static inline int16_t
44
static inline int16_t
 Lines 173-182   dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, Link Here 
173
    uint8_t *start = buff;
176
    uint8_t *start = buff;
174
    uint8_t *end = buff + buff_size;
177
    uint8_t *end = buff + buff_size;
175
    int16_t *out_samples = data;
178
    int16_t *out_samples = data;
176
    int sample_rate;
177
    int frame_length;
179
    int frame_length;
178
    int flags;
180
    int flags;
179
    int bit_rate;
180
    int len;
181
    int len;
181
    level_t level;
182
    level_t level;
182
    sample_t bias;
183
    sample_t bias;
 Lines 201-208   dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, Link Here 
201
        if(s->bufpos != s->buf + HEADER_SIZE)
202
        if(s->bufpos != s->buf + HEADER_SIZE)
202
            break;
203
            break;
203
204
204
        length = dts_syncinfo(s->state, s->buf, &flags, &sample_rate,
205
        length = dts_syncinfo(s->state, s->buf, &s->flags, &s->sample_rate,
205
                              &bit_rate, &frame_length);
206
                              &s->bit_rate, &frame_length);
206
        if(!length) {
207
        if(!length) {
207
            av_log(NULL, AV_LOG_INFO, "skip\n");
208
            av_log(NULL, AV_LOG_INFO, "skip\n");
208
            for(s->bufptr = s->buf; s->bufptr < s->buf + HEADER_SIZE - 1; s->bufptr++)
209
            for(s->bufptr = s->buf; s->bufptr < s->buf + HEADER_SIZE - 1; s->bufptr++)
 Lines 215-229   dts_decode_frame(AVCodecContext * avctx, void *data, int *data_size, Link Here 
215
    level = CONVERT_LEVEL;
216
    level = CONVERT_LEVEL;
216
    bias = CONVERT_BIAS;
217
    bias = CONVERT_BIAS;
217
218
218
    flags |= DTS_ADJUST_LEVEL;
219
    flags = s->flags | DTS_ADJUST_LEVEL;
219
    if(dts_frame(s->state, s->buf, &flags, &level, bias)) {
220
    if(dts_frame(s->state, s->buf, &flags, &level, bias)) {
220
        av_log(avctx, AV_LOG_ERROR, "dts_frame() failed\n");
221
        av_log(avctx, AV_LOG_ERROR, "dts_frame() failed\n");
221
        goto end;
222
        goto end;
222
    }
223
    }
223
224
224
    avctx->sample_rate = sample_rate;
225
    avctx->sample_rate = s->sample_rate;
225
    avctx->channels = channels_multi(flags);
226
    avctx->channels = channels_multi(flags);
226
    avctx->bit_rate = bit_rate;
227
    avctx->bit_rate = s->bit_rate;
227
228
228
    nblocks = dts_blocks_num(s->state);
229
    nblocks = dts_blocks_num(s->state);
229
230