@ -305,10 +305,9 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
av_get_picture_type_char ( ref - > video - > pict_type ) ) ;
}
if ( ref - > audio ) {
av_dlog ( ctx , " cl:% " PRId64 " d s n:%d s:%d s r:%d p:%d " ,
av_dlog ( ctx , " cl:% " PRId64 " d n:%d r:%d p:%d " ,
ref - > audio - > channel_layout ,
ref - > audio - > nb_samples ,
ref - > audio - > size ,
ref - > audio - > sample_rate ,
ref - > audio - > planar ) ;
}
@ -405,16 +404,16 @@ fail:
}
AVFilterBufferRef * avfilter_get_audio_buffer ( AVFilterLink * link , int perms ,
enum AVSampleFormat sample_fmt , int size ,
enum AVSampleFormat sample_fmt , int nb_samples ,
int64_t channel_layout , int planar )
{
AVFilterBufferRef * ret = NULL ;
if ( link - > dstpad - > get_audio_buffer )
ret = link - > dstpad - > get_audio_buffer ( link , perms , sample_fmt , size , channel_layout , planar ) ;
ret = link - > dstpad - > get_audio_buffer ( link , perms , sample_fmt , nb_samples , channel_layout , planar ) ;
if ( ! ret )
ret = avfilter_default_get_audio_buffer ( link , perms , sample_fmt , size , channel_layout , planar ) ;
ret = avfilter_default_get_audio_buffer ( link , perms , sample_fmt , nb_samples , channel_layout , planar ) ;
if ( ret )
ret - > type = AVMEDIA_TYPE_AUDIO ;
@ -545,6 +544,7 @@ void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
{
void ( * filter_samples ) ( AVFilterLink * , AVFilterBufferRef * ) ;
AVFilterPad * dst = link - > dstpad ;
int i ;
FF_DPRINTF_START ( NULL , filter_samples ) ; ff_dlog_link ( NULL , link , 1 ) ;
@ -561,14 +561,15 @@ void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
link - > cur_buf = avfilter_default_get_audio_buffer ( link , dst - > min_perms ,
samplesref - > format ,
samplesref - > audio - > size ,
samplesref - > audio - > nb_samples ,
samplesref - > audio - > channel_layout ,
samplesref - > audio - > planar ) ;
link - > cur_buf - > pts = samplesref - > pts ;
link - > cur_buf - > audio - > sample_rate = samplesref - > audio - > sample_rate ;
/* Copy actual data into new samples buffer */
memcpy ( link - > cur_buf - > data [ 0 ] , samplesref - > data [ 0 ] , samplesref - > audio - > size ) ;
for ( i = 0 ; samplesref - > data [ i ] ; i + + )
memcpy ( link - > cur_buf - > data [ i ] , samplesref - > data [ i ] , samplesref - > linesize [ 0 ] ) ;
avfilter_unref_buffer ( samplesref ) ;
} else