[FFmpeg-devel] [PATCH] ffplay: change type for channels and channel_layout AudioParams fields

Marton Balint cus at passwd.hu
Mon Feb 4 00:56:16 CET 2013


On Sun, 3 Feb 2013, Stefano Sabatini wrote:

> Switch from int to int64_t, to better reflect the type of the
> corresponding fields in lavc/lavfi.
> ---
> ffplay.c |   10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/ffplay.c b/ffplay.c
> index 0f0170f..199b0f6 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -135,8 +135,8 @@ typedef struct SubPicture {
>
> typedef struct AudioParams {
>     int freq;
> -    int channels;
> -    int channel_layout;
> +    int64_t channels;
> +    int64_t channel_layout;
>     enum AVSampleFormat fmt;
> } AudioParams;
>
> @@ -2152,9 +2152,9 @@ static int audio_decode_frame(VideoState *is)
>                                                  dec_channel_layout,           is->frame->format, is->frame->sample_rate,
>                                                  0, NULL);
>                 if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) {
> -                    fprintf(stderr, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n",
> -                        is->frame->sample_rate,   av_get_sample_fmt_name(is->frame->format), (int)is->frame->channels,
> -                        is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
> +                    fprintf(stderr, "Cannot create sample rate converter for conversion of %d Hz %s %"PRId64" channels to %d Hz %s %"PRId64" channels!\n",
> +                            is->frame->sample_rate, av_get_sample_fmt_name(is->frame->format), is->frame->channels,
> +                            is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
>                     break;
>                 }
>                 is->audio_src.channel_layout = dec_channel_layout;

LGTM, thanks.

Marton


More information about the ffmpeg-devel mailing list