Revision 5d6e4c16 libavcodec/pcm-mpeg.c

View differences:

libavcodec/pcm-mpeg.c
72 72
        av_log(avctx, AV_LOG_ERROR, "unsupported sample depth (0)\n");
73 73
        return -1;
74 74
    }
75
    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? SAMPLE_FMT_S16 :
76
                                                             SAMPLE_FMT_S32;
75
    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16 :
76
                                                             AV_SAMPLE_FMT_S32;
77 77

  
78 78
    /* get the sample rate. Not all values are known or exist. */
79 79
    switch (header[2] & 0x0f) {
......
146 146
    samples = buf_size / sample_size;
147 147

  
148 148
    output_size = samples * avctx->channels *
149
                  (avctx->sample_fmt == SAMPLE_FMT_S32 ? 4 : 2);
149
                  (avctx->sample_fmt == AV_SAMPLE_FMT_S32 ? 4 : 2);
150 150
    if (output_size > *data_size) {
151 151
        av_log(avctx, AV_LOG_ERROR,
152 152
               "Insufficient output buffer space (%d bytes, needed %d bytes)\n",
......
162 162
        case CH_LAYOUT_4POINT0:
163 163
        case CH_LAYOUT_2_2:
164 164
            samples *= num_source_channels;
165
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
165
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
166 166
#if HAVE_BIGENDIAN
167 167
                memcpy(dst16, src, output_size);
168 168
#else
......
181 181
        case CH_LAYOUT_SURROUND:
182 182
        case CH_LAYOUT_2_1:
183 183
        case CH_LAYOUT_5POINT0:
184
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
184
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
185 185
                do {
186 186
#if HAVE_BIGENDIAN
187 187
                    memcpy(dst16, src, avctx->channels * 2);
......
207 207
            break;
208 208
            /* remapping: L, R, C, LBack, RBack, LF */
209 209
        case CH_LAYOUT_5POINT1:
210
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
210
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
211 211
                do {
212 212
                    dst16[0] = bytestream_get_be16(&src);
213 213
                    dst16[1] = bytestream_get_be16(&src);
......
231 231
            break;
232 232
            /* remapping: L, R, C, LSide, LBack, RBack, RSide, <unused> */
233 233
        case CH_LAYOUT_7POINT0:
234
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
234
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
235 235
                do {
236 236
                    dst16[0] = bytestream_get_be16(&src);
237 237
                    dst16[1] = bytestream_get_be16(&src);
......
259 259
            break;
260 260
            /* remapping: L, R, C, LSide, LBack, RBack, RSide, LF */
261 261
        case CH_LAYOUT_7POINT1:
262
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
262
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
263 263
                do {
264 264
                    dst16[0] = bytestream_get_be16(&src);
265 265
                    dst16[1] = bytestream_get_be16(&src);
......
304 304
    NULL,
305 305
    NULL,
306 306
    pcm_bluray_decode_frame,
307
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16, SAMPLE_FMT_S32,
308
                                         SAMPLE_FMT_NONE},
307
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
308
                                         AV_SAMPLE_FMT_NONE},
309 309
    .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"),
310 310
};

Also available in: Unified diff