[FFmpeg-devel] [PATCH] lavfi/buffersrc: set channel layout if it is known.

Michael Niedermayer michaelni at gmx.at
Sat Mar 16 00:13:27 CET 2013


On Thu, Mar 14, 2013 at 07:59:09PM +0100, Nicolas George wrote:
> Introduced in 01649c7, lost in the API change.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/buffersrc.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> With this patch and the other recent one:
> "lavc: do not init frame with guessed layout."
> it becomes possible to transcode files with unknown layout again.
> 
> Without this patch, init fails with the following error if the codec has a
> list of supported layouts (see the explanations in the commit message for
> 01649c7):
> 
> Unable to find default channel layout for Input Stream #0.0
> 
> Without the other patch, buffersrc is inited for an unknown layout but
> frames are added with a guessed layout, causing endless error messages about
> "Changing frame properties on the fly is not supported.".
> 
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index 80fd2be..d3f14cd 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -134,6 +134,8 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
>                                   frame->format);
>          break;
>      case AVMEDIA_TYPE_AUDIO:
> +        if (!frame->channel_layout)
> +            frame->channel_layout = s->channel_layout;

this could set an inconsistent layout i think,
consider s->channel_layout is mono and frame->channels=3

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130316/4160d191/attachment.asc>


More information about the ffmpeg-devel mailing list