[FFmpeg-cvslog] doc/examples/muxing: Fixes frame initialization.
Andre Anjos
git at videolan.org
Thu Jan 9 18:21:02 CET 2014
ffmpeg | branch: master | Andre Anjos <andre.anjos at idiap.ch> | Tue Oct 29 11:28:26 2013 +0100| [23ffc4c70d5990a173b424cc2409fb76557cfc8a] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23ffc4c70d5990a173b424cc2409fb76557cfc8a
---
doc/examples/muxing.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index bbc66d6..d27c5c1 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);
More information about the ffmpeg-cvslog
mailing list