summaryrefslogtreecommitdiff
path: root/doc/examples/muxing.c
diff options
context:
space:
mode:
authorAndre Anjos <andre.anjos@idiap.ch>2013-10-29 11:28:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-09 18:12:24 +0100
commit23ffc4c70d5990a173b424cc2409fb76557cfc8a (patch)
tree3bc8a0ce93b4c010213292bd122374693da00f82 /doc/examples/muxing.c
parentcab5315519ff8172f3b07dbcc4d4829ae567b1a9 (diff)
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>
Diffstat (limited to 'doc/examples/muxing.c')
-rw-r--r--doc/examples/muxing.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index bbc66d693d..d27c5c16d8 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -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);