Revision ff2614ee libavdevice/alsa-audio-common.c

View differences:

libavdevice/alsa-audio-common.c
51 51
    }
52 52
}
53 53

  
54
#define REORDER_OUT_50(NAME, TYPE) \
55
static void alsa_reorder_ ## NAME ## _out_50(const void *in_v, void *out_v, int n) \
56
{ \
57
    const TYPE *in = in_v; \
58
    TYPE * out = out_v; \
59
\
60
    while (n-- > 0) { \
61
        out[0] = in[0]; \
62
        out[1] = in[1]; \
63
        out[2] = in[3]; \
64
        out[3] = in[4]; \
65
        out[4] = in[2]; \
66
        in  += 5; \
67
        out += 5; \
68
    } \
69
}
70

  
54 71
#define REORDER_OUT_51(NAME, TYPE) \
55 72
static void alsa_reorder_ ## NAME ## _out_51(const void *in_v, void *out_v, int n) \
56 73
{ \
......
89 106
    } \
90 107
}
91 108

  
109
REORDER_OUT_50(s16, int16_t)
92 110
REORDER_OUT_51(s16, int16_t)
93 111
REORDER_OUT_71(s16, int16_t)
112
REORDER_OUT_50(s32, int32_t)
94 113
REORDER_OUT_51(s32, int32_t)
95 114
REORDER_OUT_71(s32, int32_t)
96 115

  
......
102 121
{
103 122
    return
104 123
    codec_id == CODEC_ID_PCM_S16LE || codec_id == CODEC_ID_PCM_S16BE ?
124
        layout == AV_CH_LAYOUT_5POINT0_BACK || layout == AV_CH_LAYOUT_5POINT0 ?
125
            out ? alsa_reorder_s16_out_50 : NULL :
105 126
        layout == AV_CH_LAYOUT_QUAD ? REORDER_DUMMY :
106 127
        layout == AV_CH_LAYOUT_5POINT1_BACK || layout == AV_CH_LAYOUT_5POINT1 ?
107 128
            out ? alsa_reorder_s16_out_51 : NULL :
......
109 130
            out ? alsa_reorder_s16_out_71 : NULL :
110 131
            NULL :
111 132
    codec_id == CODEC_ID_PCM_S32LE || codec_id == CODEC_ID_PCM_S32BE ?
133
        layout == AV_CH_LAYOUT_5POINT0_BACK || layout == AV_CH_LAYOUT_5POINT0 ?
134
            out ? alsa_reorder_s32_out_50 : NULL :
112 135
        layout == AV_CH_LAYOUT_5POINT1_BACK || layout == AV_CH_LAYOUT_5POINT1 ?
113 136
            out ? alsa_reorder_s32_out_51 : NULL :
114 137
        layout == AV_CH_LAYOUT_7POINT1 ?

Also available in: Unified diff