[FFmpeg-devel] [PATCH] avformat/riffenc: fix handling monowhite when pix_fmt is not set

Michael Niedermayer michael at niedermayer.cc
Tue Feb 23 17:23:21 CET 2016


On Tue, Feb 23, 2016 at 04:14:09PM +0100, Mats Peterson wrote:
> On 02/23/2016 03:54 PM, Michael Niedermayer wrote:
> >On Tue, Feb 23, 2016 at 01:41:54PM +0100, Mats Peterson wrote:
> >>On 02/23/2016 01:11 PM, Michael Niedermayer wrote:
> >>>Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> >>
> >>When is pix_fmt AV_PIX_FMT_NONE in this context? Sorry if I sound
> >>uninitiated.
> >
> >the pix_fmt describes the decoder output and encoder input
> >demuxers may set it but do not have to (especially if theres nothing
> >in their headers that contains that information)
> >
> >AV_PIX_FMT_NONE is the default if it has not been set
> >
> >this is documented in the header defining the field (avcodec.h)
> >
> >[...]
> >
> >
> >
> >_______________________________________________
> >ffmpeg-devel mailing list
> >ffmpeg-devel at ffmpeg.org
> >http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> That sounds overly paranoid. I haven't been able to produce a case
> where pix_fmt is AV_PIX_FMT_NONE here.
> 
> Please answer the following questions:
> 
> 1. What about "enum AVPixelFormat pix_fmt = enc->pix_fmt"? What good
> does it do? enc->pix_fmt is already a proper AVPixelFormat enum.

The code uses a temporary variable so it does not overwrite the callers
input settings.


> 
> 2. You say that demuxers might not set the pixel format. This is on
> the muxing side though. Isn't the pixel format always set when
> muxing?

theres no guratee that its set for the muxer
there could be demuxer -> muxer with no decoder as well but thats
not the only case, it could just be that the application doesnt
set it, its not written in the API that the application has to set it


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160223/d9b28a5e/attachment.sig>


More information about the ffmpeg-devel mailing list