wavenc: fix writing channel map
Position mask should be build out of masks rather than channel values.
Try to create a wav
file with following channel map:
Channels: 10 (front-left, front-right, front-center, lfe1, rear-left, rear-right, top-front-left, top-front-right, top-rear-left, top-rear-right)
with
gst-launch-1.0 -v audiotestsrc num-buffers=10 ! "audio/x-raw,channels=10,channel-mask=(bitmask)0x3303f" ! wavenc ! filesink location=out.wav
- Before patch:
wavenc gstwavenc.c:490:gst_wavenc_sink_setcaps:<wavenc0> Channel mask input: 0x3303f output: 0x0
gst-discoverer-1.0 out.wav
Analyzing file:///out.wav
Done discovering file:///out.wav
Properties:
Duration: 0:00:00.232199547
Seekable: yes
Live: no
audio #0: WAV
Stream ID: 108c10f8631165a7e68549fb47270246
Language: <unknown>
Channels: 10 (unknown layout)
Sample rate: 44100
Depth: 16
Bitrate: 7056000
Max bitrate: 0
- After patch:
wavenc gstwavenc.c:490:gst_wavenc_sink_setcaps:<wavenc0> Channel mask input: 0x3303f output: 0x2d03f
gst-discoverer-1.0 out.wav
Analyzing file:///out.wav
Done discovering file:///out.wav
Properties:
Duration: 0:00:00.232199547
Seekable: yes
Live: no
audio #0: WAV
Stream ID: ca23499c0f0651d11d00e976395c1db0
Language: <unknown>
Channels: 10 (front-left, front-right, front-center, lfe1, rear-left, rear-right, top-front-left, top-front-right, top-rear-left, top-rear-right)
Sample rate: 44100
Depth: 16
Bitrate: 7056000
Max bitrate: 0