Commit b3befdf4 authored by Dennis van Amerongen's avatar Dennis van Amerongen

NEWS: remove FLAC issues, this was fixed in 0.8.6d already

parent abaf8969
...@@ -13,7 +13,6 @@ Security updates: ...@@ -13,7 +13,6 @@ Security updates:
* Fixed buffer overflow in the SDL_image library (CVE-2006-4484) * Fixed buffer overflow in the SDL_image library (CVE-2006-4484)
* Real RTSP overflows (CVE-2008-0295, CVE-2008-0296, VideoLAN-SA-0801) * Real RTSP overflows (CVE-2008-0295, CVE-2008-0296, VideoLAN-SA-0801)
* Arbitrary memory overwrite in the MP4 demuxer (CORE-2008-0130, VideoLAN-SA-0802) * Arbitrary memory overwrite in the MP4 demuxer (CORE-2008-0130, VideoLAN-SA-0802)
* FLAC issues (CVE-2007-4619)
Audio filter: Audio filter:
* Fixed DTS to S/PDIF converter * Fixed DTS to S/PDIF converter
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include "audio_output.h" #include "audio_output.h"
#include "aout_internal.h" #include "aout_internal.h"
#include <vlc_filter.h>
#include <vlc_block.h>
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
...@@ -39,6 +41,9 @@ static int Create ( vlc_object_t * ); ...@@ -39,6 +41,9 @@ static int Create ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *, static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * ); aout_buffer_t * );
static int OpenFilter ( vlc_object_t * );
static block_t *Filter( filter_t *, block_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -48,6 +53,11 @@ vlc_module_begin(); ...@@ -48,6 +53,11 @@ vlc_module_begin();
set_category( CAT_AUDIO ); set_category( CAT_AUDIO );
set_subcategory( SUBCAT_AUDIO_MISC ); set_subcategory( SUBCAT_AUDIO_MISC );
set_callbacks( Create, NULL ); set_callbacks( Create, NULL );
add_submodule();
set_description( _("audio filter for simple channel mixing") );
set_capability( "audio filter2", 10 );
set_callbacks( OpenFilter, NULL );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
...@@ -68,24 +78,27 @@ static int Create( vlc_object_t *p_this ) ...@@ -68,24 +78,27 @@ static int Create( vlc_object_t *p_this )
return -1; return -1;
} }
/* Only conversion to Stereo and 4.0 right now */ /* Only conversion to Mono, Stereo and 4.0 right now */
if( p_filter->output.i_physical_channels != if( p_filter->output.i_physical_channels !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT) (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)
&& p_filter->output.i_physical_channels != && p_filter->output.i_physical_channels !=
( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | ( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) ) AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT)
{ && p_filter->output.i_physical_channels != AOUT_CHAN_CENTER )
return -1; {
} return -1;
}
/* Only from 7/7.1/5/5.1 */ /* Only from 7/7.1/5/5.1/2.0 */
if( (p_filter->input.i_physical_channels & ~AOUT_CHAN_LFE) != if( (p_filter->input.i_physical_channels & ~AOUT_CHAN_LFE) !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) && AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) &&
(p_filter->input.i_physical_channels & ~AOUT_CHAN_LFE) != (p_filter->input.i_physical_channels & ~AOUT_CHAN_LFE) !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER |
AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) ) AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) &&
p_filter->input.i_physical_channels !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT) )
{ {
return -1; return -1;
} }
...@@ -139,6 +152,37 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, ...@@ -139,6 +152,37 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++; if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
} }
} }
else if( p_filter->output.i_physical_channels == AOUT_CHAN_CENTER )
{
if( p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLELEFT )
for( i = p_in_buf->i_nb_samples; i--; )
{
*p_dest = p_src[6] + p_src[0] / 4 + p_src[1] / 4 + p_src[2] / 8 + p_src[3] / 8 + p_src[4] / 8 + p_src[5] / 8;
p_dest++;
p_src += 7;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if( p_filter->input.i_physical_channels & AOUT_CHAN_REARLEFT )
for( i = p_in_buf->i_nb_samples; i--; )
{
*p_dest = p_src[4] + p_src[0] / 4 + p_src[1] / 4 + p_src[2] / 6 + p_src[3] / 6;
p_dest++;
p_src += 5;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else
for( i = p_in_buf->i_nb_samples; i--; )
{
*p_dest = p_src[0] / 2 + p_src[1] / 2;
p_dest++;
p_src += 2;
}
}
else else
{ {
if( p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLELEFT ) if( p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLELEFT )
...@@ -176,3 +220,108 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, ...@@ -176,3 +220,108 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
} }
} }
/*****************************************************************************
* OpenFilter:
*****************************************************************************/
static int OpenFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
if ( (p_filter->fmt_in.audio.i_physical_channels
== p_filter->fmt_out.audio.i_physical_channels
&& p_filter->fmt_in.audio.i_original_channels
== p_filter->fmt_out.audio.i_original_channels)
|| p_filter->fmt_in.i_codec != p_filter->fmt_out.i_codec
|| p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate
|| p_filter->fmt_in.i_codec != VLC_FOURCC('f','l','3','2') )
{
return -1;
}
/* Only conversion to Mono, Stereo and 4.0 right now */
if( p_filter->fmt_out.audio.i_physical_channels !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)
&& p_filter->fmt_out.audio.i_physical_channels !=
( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT)
&& p_filter->fmt_out.audio.i_physical_channels != AOUT_CHAN_CENTER )
{
return -1;
}
/* Only from 7/7.1/5/5.1/2.0 */
if( (p_filter->fmt_in.audio.i_physical_channels & ~AOUT_CHAN_LFE) !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) &&
(p_filter->fmt_in.audio.i_physical_channels & ~AOUT_CHAN_LFE) !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER |
AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT) &&
p_filter->fmt_in.audio.i_physical_channels !=
(AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT) )
{
return -1;
}
p_filter->pf_audio_filter = Filter;
return 0;
}
/*****************************************************************************
* Filter:
*****************************************************************************/
static block_t *Filter( filter_t *p_filter, block_t *p_block )
{
aout_filter_t aout_filter;
aout_buffer_t in_buf, out_buf;
block_t *p_out;
int i_out_size;
if( !p_block || !p_block->i_samples )
{
if( p_block ) p_block->pf_release( p_block );
return NULL;
}
i_out_size = p_block->i_samples *
p_filter->fmt_out.audio.i_bitspersample *
p_filter->fmt_out.audio.i_channels / 8;
p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
if( !p_out )
{
msg_Warn( p_filter, "can't get output buffer" );
p_block->pf_release( p_block );
return NULL;
}
p_out->i_samples = p_block->i_samples;
p_out->i_dts = p_block->i_dts;
p_out->i_pts = p_block->i_pts;
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.input = p_filter->fmt_in.audio;
aout_filter.input.i_format = p_filter->fmt_in.i_codec;
aout_filter.output = p_filter->fmt_out.audio;
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_nb_bytes = p_block->i_buffer;
in_buf.i_nb_samples = p_block->i_samples;
out_buf.p_buffer = p_out->p_buffer;
out_buf.i_nb_bytes = p_out->i_buffer;
out_buf.i_nb_samples = p_out->i_samples;
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
p_block->pf_release( p_block );
p_out->i_buffer = out_buf.i_nb_bytes;
p_out->i_samples = out_buf.i_nb_samples;
return p_out;
}
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