~siretart/libav/trusty

« back to all changes in this revision

Viewing changes to libavcodec/gsm_parser.c

  • Committer: Reinhard Tartler
  • Date: 2013-10-23 03:04:17 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: siretart@tauware.de-20131023030417-1o6mpkl1l0raifjt
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
typedef struct GSMParseContext {
32
32
    ParseContext pc;
33
33
    int block_size;
 
34
    int duration;
34
35
    int remaining;
35
36
} GSMParseContext;
36
37
 
44
45
 
45
46
    if (!s->block_size) {
46
47
        switch (avctx->codec_id) {
47
 
        case CODEC_ID_GSM:    s->block_size = GSM_BLOCK_SIZE;    break;
48
 
        case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break;
 
48
        case AV_CODEC_ID_GSM:
 
49
            s->block_size = GSM_BLOCK_SIZE;
 
50
            s->duration   = GSM_FRAME_SIZE;
 
51
            break;
 
52
        case AV_CODEC_ID_GSM_MS:
 
53
            s->block_size = GSM_MS_BLOCK_SIZE;
 
54
            s->duration   = GSM_FRAME_SIZE * 2;
 
55
            break;
49
56
        default:
50
57
            return AVERROR(EINVAL);
51
58
        }
66
73
        *poutbuf_size = 0;
67
74
        return buf_size;
68
75
    }
 
76
 
 
77
    s1->duration = s->duration;
 
78
 
69
79
    *poutbuf      = buf;
70
80
    *poutbuf_size = buf_size;
71
81
    return next;
72
82
}
73
83
 
74
84
AVCodecParser ff_gsm_parser = {
75
 
    .codec_ids      = { CODEC_ID_GSM, CODEC_ID_GSM_MS },
 
85
    .codec_ids      = { AV_CODEC_ID_GSM, AV_CODEC_ID_GSM_MS },
76
86
    .priv_data_size = sizeof(GSMParseContext),
77
87
    .parser_parse   = gsm_parse,
78
88
    .parser_close   = ff_parse_close,