Commit 05627b66 authored by Jai Menon's avatar Jai Menon Committed by Jean-Baptiste Kempf

WAV Mux : Extend the muxer to support non-PCM codecs.

Currently, the muxer generates invalid files whenever any streams
with  non-PCM codecs are used as input. This is fixed by adding a few
additional waveformat tags to the wave_format_tag_to_fourcc table and
using the fourcc_to_wf_tag utility function.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c1a7d8e3
...@@ -309,8 +309,14 @@ static const struct ...@@ -309,8 +309,14 @@ static const struct
wave_format_tag_to_fourcc[] = wave_format_tag_to_fourcc[] =
{ {
{ WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" }, { WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S8, "PCM S8 audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S16L, "PCM S16L audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S24L, "PCM S24L audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S32L, "PCM S32L audio" },
{ WAVE_FORMAT_ADPCM, VLC_CODEC_ADPCM_MS, "ADPCM" }, { WAVE_FORMAT_ADPCM, VLC_CODEC_ADPCM_MS, "ADPCM" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" }, { WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_CODEC_F32L, "PCM 32 (Float) audio" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_CODEC_F64L, "PCM 64 (Float) audio" },
{ WAVE_FORMAT_ALAW, VLC_CODEC_ALAW, "A-Law" }, { WAVE_FORMAT_ALAW, VLC_CODEC_ALAW, "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_CODEC_MULAW, "Mu-Law" }, { WAVE_FORMAT_MULAW, VLC_CODEC_MULAW, "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM, VLC_CODEC_ADPCM_IMA_WAV, "Ima-ADPCM" }, { WAVE_FORMAT_IMA_ADPCM, VLC_CODEC_ADPCM_IMA_WAV, "Ima-ADPCM" },
......
...@@ -204,8 +204,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -204,8 +204,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_sys->i_channel_mask, (int)p_sys->b_chan_reorder ); p_sys->i_channel_mask, (int)p_sys->b_chan_reorder );
} }
i_format = p_input->p_fmt->i_codec == VLC_CODEC_FL32 ? fourcc_to_wf_tag( p_input->p_fmt->i_codec, &i_format );
WAVE_FORMAT_IEEE_FLOAT : WAVE_FORMAT_PCM;
b_ext = p_sys->b_ext = p_input->p_fmt->audio.i_channels > 2; b_ext = p_sys->b_ext = p_input->p_fmt->audio.i_channels > 2;
/* Build a WAV header for the output data */ /* Build a WAV header for the output data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment