diff -Nru vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/debian/changelog vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/debian/changelog --- vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/debian/changelog 2017-01-24 05:29:22.000000000 +0000 +++ vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/debian/changelog 2017-01-25 05:25:55.000000000 +0000 @@ -1,8 +1,8 @@ -vlc (2.2.2+git20170124+r58920+56~ubuntu16.04.1) xenial; urgency=low +vlc (2.2.2+git20170124+r58921+56~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Launchpad Package Builder Tue, 24 Jan 2017 05:29:22 +0000 + -- Launchpad Package Builder Wed, 25 Jan 2017 05:25:55 +0000 vlc (2.2.2-5) unstable; urgency=medium diff -Nru vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/debian/git-build-recipe.manifest vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/debian/git-build-recipe.manifest --- vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/debian/git-build-recipe.manifest 2017-01-24 05:29:22.000000000 +0000 +++ vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/debian/git-build-recipe.manifest 2017-01-25 05:25:55.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version {debupstream}+git20170124+r58920+56 -lp:~videolan/vlc/+git/vlc-2.2 git-commit:9aeb287acd2e2f8eda4fb713add222283b67c3c3 +# git-build-recipe format 0.4 deb-version {debupstream}+git20170124+r58921+56 +lp:~videolan/vlc/+git/vlc-2.2 git-commit:184257c6b62082e4116210fe80e7ed021812373b merge packaging lp:~videolan/vlc/+git/packaging git-commit:344abb46cb450ef04aaba9a08235573e133b487e diff -Nru vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/modules/audio_filter/stereo_widen.c vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/modules/audio_filter/stereo_widen.c --- vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/modules/audio_filter/stereo_widen.c 2017-01-24 05:29:14.000000000 +0000 +++ vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/modules/audio_filter/stereo_widen.c 2017-01-25 05:25:46.000000000 +0000 @@ -41,15 +41,13 @@ struct filter_sys_t { - float *pf_begin; /* circular buffer to store samples */ + float *pf_ringbuf; /* circular buffer to store samples */ float *pf_write; /* where to write current sample */ - int i_len; /* delay in number of samples */ + size_t i_len; /* delay in number of samples */ float f_delay; /* delay in milliseconds */ float f_feedback; float f_crossfeed; float f_dry_mix; - bool b_free_buf; /* used if callback to delay fails to * - * allocate buffer, then dont free it twice */ }; #define HELP_TEXT N_("This filter enhances the stereo effect by "\ @@ -82,7 +80,8 @@ set_capability( "audio filter", 0 ) set_callbacks( Open, Close ) - add_float( "delay", 20, DELAY_TEXT, DELAY_LONGTEXT, true ) + add_float_with_range( "delay", 20, 1, 100, + DELAY_TEXT, DELAY_LONGTEXT, true ) add_float_with_range( "feedback", 0.3, 0.0, 0.9, FEEDBACK_TEXT, FEEDBACK_LONGTEXT, true ) add_float_with_range( "crossfeed", 0.3, 0.0, 0.8, @@ -94,6 +93,25 @@ /***************************************************************************** * Open: Allocate buffer *****************************************************************************/ +static int MakeRingBuffer( float **pp_buffer, size_t *pi_buffer, + float **pp_write, float f_delay, unsigned i_rate ) +{ + const size_t i_size = (2 * (size_t)(1 + f_delay * i_rate / 1000)); + + if( unlikely(SIZE_MAX / sizeof(float) < i_size) ) + return VLC_EGENERIC; + + float *p_realloc = realloc( *pp_buffer, i_size * sizeof(float) ); + if( !p_realloc ) + return VLC_ENOMEM; + + memset( p_realloc, 0, i_size * sizeof(float) ); + *pp_write = *pp_buffer = p_realloc; + *pi_buffer = i_size; + + return VLC_SUCCESS; +} + static int Open( vlc_object_t *obj ) { filter_t *p_filter = (filter_t *)obj; @@ -123,20 +141,19 @@ CREATE_VAR( f_dry_mix, "dry-mix" ) /* Compute buffer length and allocate space */ - p_sys->i_len = 2 * p_sys->f_delay * p_filter->fmt_in.audio.i_rate / 1000; - p_sys->pf_begin = calloc( p_sys->i_len + 2, sizeof(float) ); - if( unlikely(!p_sys->pf_begin) ) + p_sys->pf_ringbuf = NULL; + p_sys->i_len = 0; + if( MakeRingBuffer( &p_sys->pf_ringbuf, &p_sys->i_len, &p_sys->pf_write, + p_sys->f_delay, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS ) { free( p_sys ); return VLC_ENOMEM; } - p_sys->b_free_buf = true; - p_sys->pf_write = p_sys->pf_begin; + p_filter->pf_audio_filter = Filter; return VLC_SUCCESS; } - /***************************************************************************** * Filter: process each sample *****************************************************************************/ @@ -150,8 +167,8 @@ { pf_read = p_sys->pf_write + 2; /* if at end of buffer put read ptr at begin */ - if( pf_read > p_sys->pf_begin + p_sys->i_len ) - pf_read = p_sys->pf_begin; + if( pf_read >= p_sys->pf_ringbuf + p_sys->i_len ) + pf_read = p_sys->pf_ringbuf; float left = p_out[0]; float right = p_out[1]; @@ -160,14 +177,12 @@ - p_sys->f_feedback * pf_read[1]; *(p_out++) = p_sys->f_dry_mix * right - p_sys->f_crossfeed * left - p_sys->f_feedback * pf_read[0]; - p_sys->pf_write[0] = left ; - p_sys->pf_write[1] = right; + *(p_sys->pf_write++) = left ; + *(p_sys->pf_write++) = right; /* if at end of buffer place pf_write at begin */ - if( p_sys->pf_write == p_sys->pf_begin + p_sys->i_len ) - p_sys->pf_write = p_sys->pf_begin; - else - p_sys->pf_write += 2; + if( p_sys->pf_write == p_sys->pf_ringbuf + p_sys->i_len ) + p_sys->pf_write = p_sys->pf_ringbuf; } return p_block; @@ -189,8 +204,8 @@ DEL_VAR( "crossfeed" ); DEL_VAR( "dry-mix" ); var_Destroy( p_filter, "delay" ); - if( p_sys->b_free_buf ) - free( p_sys->pf_begin ); + + free( p_sys->pf_ringbuf ); free( p_sys ); } @@ -210,16 +225,14 @@ if( !strcmp( psz_var, "delay" ) ) { - p_sys->f_delay = newval.f_float; - /* Free previous buffer and allocate new circular buffer */ - free( p_sys->pf_begin ); - p_sys->i_len = 2 * p_sys->f_delay * p_filter->fmt_in.audio.i_rate /1000; - p_sys->pf_begin = calloc( p_sys->i_len + 2, sizeof(float) ); - if( unlikely(!p_sys->pf_begin) ) + if( MakeRingBuffer( &p_sys->pf_ringbuf, &p_sys->i_len, &p_sys->pf_write, + newval.f_float, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS ) { - p_sys->b_free_buf = false; msg_Dbg( p_filter, "Couldnt allocate buffer for delay" ); - Close( p_this ); + } + else + { + p_sys->f_delay = newval.f_float; } } else if( !strcmp( psz_var, "feedback" ) ) diff -Nru vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/.pc/.quilt_patches vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/.pc/.quilt_patches --- vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/.pc/.quilt_patches 2017-01-24 05:29:22.000000000 +0000 +++ vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/.pc/.quilt_patches 2017-01-25 05:25:56.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-1302099/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches +/home/buildd/build-RECIPEBRANCHBUILD-1302969/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches diff -Nru vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/.pc/.quilt_series vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/.pc/.quilt_series --- vlc-2.2.2+git20170124+r58920+56~ubuntu16.04.1/.pc/.quilt_series 2017-01-24 05:29:22.000000000 +0000 +++ vlc-2.2.2+git20170124+r58921+56~ubuntu16.04.1/.pc/.quilt_series 2017-01-25 05:25:56.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-1302099/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series +/home/buildd/build-RECIPEBRANCHBUILD-1302969/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series