Browse Source

doc/examples/muxing: Fixes frame initialization.

Fixes use of the example with encoders which use tha AVFrame w/h/pix_fmt fields
FFV1 is one of these codecs

We cannot easily workaround the not set fields in common code because the API
has AVFrame constant for the encoders.
Alternatives would be to fix the API or to duplicate the struct and fill in
missing fields. Or as is to require all user apps to set this correctly and
maybe simplify for that case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Andre Anjos Michael Niedermayer 12 years ago
parent
commit
23ffc4c70d
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      doc/examples/muxing.c

+ 3
- 0
doc/examples/muxing.c View File

@@ -336,6 +336,9 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st)
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
}
frame->format = c->pix_fmt;
frame->width = c->width;
frame->height = c->height;

/* Allocate the encoded raw picture. */
ret = avpicture_alloc(&dst_picture, c->pix_fmt, c->width, c->height);


Loading…
Cancel
Save