Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-08 00:39:40 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-08 00:39:40 +0400
commit67e32b4a7b085070d17ce213cec31752242f73c8 (patch)
treee2c82865882719d82665687f8779c9cff291458b /source/blender/blenkernel/intern/writeffmpeg.c
parentacb796c623700c8a869e602467bd650ebc02b6ce (diff)
Fix for wrong pixel format used for qtrle
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 1e2791acfee..bae4d9c4b4e 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -78,7 +78,6 @@ static AVFormatContext* outfile = 0;
static AVStream* video_stream = 0;
static AVStream* audio_stream = 0;
static AVFrame* current_frame = 0;
-static int img_convert_fmt = 0;
static struct SwsContext *img_convert_ctx = 0;
static uint8_t* video_buffer = 0;
@@ -293,8 +292,8 @@ static AVFrame* generate_video_frame(uint8_t* pixels, ReportList *reports)
int height = c->height;
AVFrame* rgb_frame;
- if (c->pix_fmt != img_convert_fmt) {
- rgb_frame = alloc_picture(img_convert_fmt, width, height);
+ if (c->pix_fmt != PIX_FMT_BGR32) {
+ rgb_frame = alloc_picture(PIX_FMT_BGR32, width, height);
if (!rgb_frame) {
BKE_report(reports, RPT_ERROR, "Couldn't allocate temporary frame.");
return NULL;
@@ -344,7 +343,7 @@ static AVFrame* generate_video_frame(uint8_t* pixels, ReportList *reports)
}
}
- if (c->pix_fmt != img_convert_fmt) {
+ if (c->pix_fmt != PIX_FMT_BGR32) {
sws_scale(img_convert_ctx, (const uint8_t * const*) rgb_frame->data,
rgb_frame->linesize, 0, c->height,
current_frame->data, current_frame->linesize);
@@ -487,8 +486,6 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
/* Be sure to use the correct pixel format(e.g. RGB, YUV) */
- img_convert_fmt = PIX_FMT_BGR32;
-
if (codec->pix_fmts) {
c->pix_fmt = codec->pix_fmts[0];
} else {
@@ -517,7 +514,6 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
if ( codec_id == CODEC_ID_QTRLE ) {
if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
c->pix_fmt = PIX_FMT_ARGB;
- img_convert_fmt = PIX_FMT_BGRA;
}
}
@@ -569,7 +565,7 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
img_convert_ctx = sws_getContext(c->width, c->height,
- img_convert_fmt,
+ PIX_FMT_BGR32,
c->width, c->height,
c->pix_fmt,
SWS_BICUBIC,