/*****************************************************************************
* dolby.c : simple decoder for dolby surround encoded streams
*****************************************************************************
- * Copyright (C) 2005 the VideoLAN team
- * $Id: headphone.c 11664 2005-07-09 06:17:09Z courmisch $
+ * Copyright (C) 2005, 2006 the VideoLAN team
+ * $Id$
*
- * Authors: Boris Dorès <babal@via.ecp.fr>
+ * Authors: Boris Dorès <babal@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h>
-#include <vlc/vlc.h>
-#include "audio_output.h"
-#include "aout_internal.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_aout.h>
/*****************************************************************************
* Local prototypes
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- set_description( N_("Simple decoder for dolby surround encoded streams") );
- set_shortname( _("Dolby surround decoder") );
+ set_description( N_("Simple decoder for Dolby Surround encoded streams") );
+ set_shortname( N_("Dolby Surround decoder") );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACODEC );
set_capability( "audio filter", 5 );
aout_filter_t * p_filter = (aout_filter_t *)p_this;
/* Validate audio filter format */
- if ( p_filter->input.i_original_channels
- != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT|AOUT_CHAN_DOLBYSTEREO )
- || aout_FormatNbChannels( &p_filter->output ) <= 2
- || p_filter->output.i_physical_channels
- != ( p_filter->output.i_original_channels & AOUT_CHAN_PHYSMASK )
- || p_filter->input.i_physical_channels
- != ( p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK ))
+ if ( p_filter->input.i_physical_channels != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
+ || ! ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
+ || aout_FormatNbChannels( &p_filter->output ) <= 2
+ || ( p_filter->input.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO )
+ != ( p_filter->output.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO ) )
{
return VLC_EGENERIC;
}
/* Allocate the memory needed to store the module's structure */
p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
if ( p_filter->p_sys == NULL )
- {
- msg_Err( p_filter, "Out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_filter->p_sys->i_left = -1;
p_filter->p_sys->i_center = -1;
p_filter->p_sys->i_right = -1;
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
+ VLC_UNUSED(p_aout);
float * p_in = (float*) p_in_buf->p_buffer;
float * p_out = (float*) p_out_buf->p_buffer;
size_t i_nb_samples = p_in_buf->i_nb_samples;