[FFmpeg-devel] [PATCH] Use channel count if channel layout is undefined

Marcin Gorzel gorzel at google.com
Fri Jul 13 14:34:01 EEST 2018


On Fri, Jul 13, 2018 at 12:15 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Tue, Jul 10, 2018 at 10:34:51AM +0100, Marcin Gorzel wrote:
> > Hi Michael,
> >
> > I think I know where the misunderstanding could be.
> >
> > The main changes in my patch are:
> >
> > rematrix.c:389 and rematrix_int.c:36:
> >
> > Before:
> > int nb_in  = av_get_channel_layout_nb_channels(s->in_ch_layout)
> >
> > After:
> > int nb_in  = s->in_ch_layout != 0
> >         ? av_get_channel_layout_nb_channels(s->in_ch_layout)
> >         : s->user_in_ch_count;
> >
>
> > However, the change you are referring to (rematrix.c:72) has been made
> just
> > to match the above changes (although you are right that functionally this
> > particular one change should be the same).
>
> This should be documented in the commit message
>

Done.


> > I just thought that
> > since av_get_channel_layout_nb_channels(s->user_in_ch_layout) was
> > originally used, there may be preference to rely on the channel layout
> > first (if available) before falling back to the user channel count.
> > Please let me know if that makes sense.
> >
> > Each field has a defined range in libswresample/options.c
> > > the AVOption code checks this when setting the field
> >
> >
> > > If the value in the table is wrong, thats what should be fixed.
> > > If something sets it ignoring the value, that code should be fixed.
> > > i dont think we should add a check without first understanding what
> > > sets it outside the range
> >
> >
> > I believe the check if the number of channels is valid is made in
> > libavcodec/utils.c:676.
>
> you are changing libswresample, the check in libavcodec looks unrelated
> to libswresample.
>

Done. (Removed changes in libavcodec - now this patch only affects
libswrsample).

> However, the output error message is quite general and possibly not very
> > helpful:
>
> Clearer error messages are certainly better, improvments to error
> messages should be welcome!
>

Channel checks (error logs) will be added as separate patch(es), as
suggested above.


>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If you fake or manipulate statistics in a paper in physics you will never
> get a job again.
> If you fake or manipulate statistics in a paper in medicin you will get
> a job for life at the pharma industry.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


-- 

Marcin Gorzel |  Software Engineer |  gorzel at google.com |


More information about the ffmpeg-devel mailing list