[FFmpeg-devel] [PATCH] ffprobe: Stash and use width and height before opening the codec

Stefano Sabatini stefasab at gmail.com
Tue Mar 19 01:37:23 CET 2013


On date Tuesday 2013-03-19 01:14:21 +0100, Michael Niedermayer encoded:
> On Mon, Mar 18, 2013 at 11:36:02PM +0100, Stefano Sabatini wrote:
[...]
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index 94e8b57..ab914c1 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -1078,9 +1078,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
> >      if ((ret = av_opt_set_dict(avctx, &tmp)) < 0)
> >          goto free_and_end;
> >  
> > -    //We only call avcodec_set_dimensions() for non h264 codecs so as not to overwrite previously setup dimensions
> > -    if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height &&
>            avctx->codec_id == AV_CODEC_ID_H264)){
> 
> > +    if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height) &&
> > +        avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_VP6F) {
> 
> this changes
> !(A && B)
> 
> to
> !A && !B

Ouch.
-- 
FFmpeg = Forgiving and Fascinating Multimedia Puritan Enhancing Gem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-utils-add-VP6F-hack-for-setting-correct-video-s.patch
Type: text/x-diff
Size: 1902 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130319/5e6e975a/attachment.bin>


More information about the ffmpeg-devel mailing list