[FFmpeg-devel] [PATCHv4] ffplay: add -af option
Stefano Sabatini
stefasab at gmail.com
Sat Mar 16 00:56:29 CET 2013
On date Saturday 2013-03-16 00:30:44 +0100, Marton Balint encoded:
> Based on a patch by Stefano Sabatini <stefasab at gmail.com>:
> http://ffmpeg.org/pipermail/ffmpeg-devel/2013-February/138452.html
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> doc/ffplay.texi | 6 ++
> ffplay.c | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Missing Changelog entry.
> 2 files changed, 173 insertions(+), 2 deletions(-)
>
> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> index 5f17902..ee160a0 100644
> --- a/doc/ffplay.texi
> +++ b/doc/ffplay.texi
> @@ -84,6 +84,12 @@ output. In the filter graph, the input is associated to the label
> ffmpeg-filters manual for more information about the filtergraph
> syntax.
>
> + at item -af @var{filter_graph}
> + at var{filter_graph} is a description of the filter graph to apply to
> +the input audio.
> +Use the option "-filters" to show all the available filters (including
> +sources and sinks).
> +
> @item -i @var{input_file}
> Read @var{input_file}.
> @end table
> diff --git a/ffplay.c b/ffplay.c
> index 8adac1c..ab1ce0b 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -191,7 +191,11 @@ typedef struct VideoState {
> AVPacket audio_pkt_temp;
> AVPacket audio_pkt;
> int audio_pkt_temp_serial;
> + int audio_last_serial;
> struct AudioParams audio_src;
> +#if CONFIG_AVFILTER
> + struct AudioParams audio_filter_src;
> +#endif
> struct AudioParams audio_tgt;
> struct SwrContext *swr_ctx;
> double audio_current_pts;
> @@ -253,6 +257,9 @@ typedef struct VideoState {
> #if CONFIG_AVFILTER
> AVFilterContext *in_video_filter; // the first filter in the video chain
> AVFilterContext *out_video_filter; // the last filter in the video chain
> + AVFilterContext *in_audio_filter; ///<the first filter in the audio chain
> + AVFilterContext *out_audio_filter; ///<the last filter in the audio chain
> + AVFilterGraph *agraph; ///<audio filter graph
nit+++: ///< is weird here (but really no need to send another patch)
[...]
> +static int configure_audio_filters(VideoState *is, const char *afilters, int force_output_format)
> +{
> + static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, PIX_FMT_NONE };
> + int sample_rates[2] = { 0, -1 };
> + int64_t channel_layouts[2] = { 0, -1 };
> + int channels[2] = { 0, -1 };
> + AVFilterContext *filt_asrc = NULL, *filt_asink = NULL;
> + char abuffer_args[256];
nit: asrc_args?
[...]
No more comments from me, I'll push tomorrow with the nits addressed
if I read no comments from other people (I don't know if you have push
rights). Thanks again.
--
FFmpeg = Fundamental and Furious Miracolous Perfectionist Earthshaking Gangster
More information about the ffmpeg-devel
mailing list