summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-04 15:49:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-04 15:49:55 +0000
commit2caa92d9358c53fccc424c5892df817c2c13b1e4 (patch)
tree8e97a9d6b8e96e71e98de8ecdab1db048403409a /ffmpeg.c
parent7d8379f2b78e255b6f8c8bee1a6d41cd8340b0a2 (diff)
fixes by Gildas Bazin <gbazin at altern dot org>
Originally committed as revision 2745 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index fb2acde6ef..306974009f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1261,18 +1261,11 @@ static int av_encode(AVFormatContext **output_files,
ost->topBand = frame_topBand;
ost->leftBand = frame_leftBand;
} else {
- uint8_t *buf;
ost->video_resample = 1;
ost->video_crop = 0; // cropping is handled as part of resample
- buf = av_malloc((codec->width * codec->height * 3) / 2);
- if (!buf)
+ if( avpicture_alloc( &ost->pict_tmp, codec->pix_fmt,
+ codec->width, codec->height ) )
goto fail;
- ost->pict_tmp.data[0] = buf;
- ost->pict_tmp.data[1] = ost->pict_tmp.data[0] + (codec->width * codec->height);
- ost->pict_tmp.data[2] = ost->pict_tmp.data[1] + (codec->width * codec->height) / 4;
- ost->pict_tmp.linesize[0] = codec->width;
- ost->pict_tmp.linesize[1] = codec->width / 2;
- ost->pict_tmp.linesize[2] = codec->width / 2;
ost->img_resample_ctx = img_resample_full_init(
ost->st->codec.width, ost->st->codec.height,