encoder_sys_t *p_sys;
/* We only support DVD LPCM yet. */
- if( p_enc->fmt_out.i_codec != VLC_CODEC_DVD_LPCM ||
- ( p_enc->fmt_in.audio.i_rate != 48000 &&
- p_enc->fmt_in.audio.i_rate != 96000 &&
- p_enc->fmt_in.audio.i_rate != 44100 &&
- p_enc->fmt_in.audio.i_rate != 32000 ) ||
- p_enc->fmt_in.audio.i_channels > 8 )
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_DVD_LPCM )
return VLC_EGENERIC;
+ if( p_enc->fmt_in.audio.i_rate != 48000 &&
+ p_enc->fmt_in.audio.i_rate != 96000 &&
+ p_enc->fmt_in.audio.i_rate != 44100 &&
+ p_enc->fmt_in.audio.i_rate != 32000 )
+ {
+ msg_Err( p_enc, "DVD LPCM supports only sample rates of 48, 96, 44.1 or 32 kHz" );
+ return VLC_EGENERIC;
+ }
+
+ if( p_enc->fmt_in.audio.i_channels > 8 )
+ {
+ msg_Err( p_enc, "DVD LPCM supports a maximum of eight channels" );
+ return VLC_EGENERIC;
+ }
+
/* Allocate the memory needed to store the encoder's structure */
if( ( p_enc->p_sys = p_sys =
(encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )