diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-10-27 00:02:23 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-10-27 00:02:23 +0000 |
commit | d6db1c9c6a331da88c3eca9b0afa939dbbf24651 (patch) | |
tree | c4059ef616e9dca7d87c6e61038d5cefe445ddba /libavcodec/mpegvideo.c | |
parent | 5d9827bcf62a543d95ea27469e3e06153f352cda (diff) | |
download | ffmpeg-d6db1c9c6a331da88c3eca9b0afa939dbbf24651.tar.gz |
handle direct rendering buffer allocation failure
Originally committed as revision 1075 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 2ec1ea397b..4761b61370 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -791,7 +791,7 @@ static void draw_edges_c(UINT8 *buf, int wrap, int width, int height, int w) } /* generic function for encode/decode called before a frame is coded/decoded */ -void MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) +int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) { int i; UINT8 *tmp; @@ -800,7 +800,10 @@ void MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) avctx->mbskip_table= s->mbskip_table; if(avctx->flags&CODEC_FLAG_DR1){ - avctx->get_buffer_callback(avctx, s->width, s->height, s->pict_type); + if(avctx->get_buffer_callback(avctx, s->width, s->height, s->pict_type) < 0){ + fprintf(stderr, "get_buffer() failed\n"); + return -1; + } s->linesize = avctx->dr_stride; s->uvlinesize= avctx->dr_uvstride; @@ -854,6 +857,8 @@ void MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->dct_unquantize = s->dct_unquantize_h263; }else s->dct_unquantize = s->dct_unquantize_mpeg1; + + return 0; } /* generic function for encode/decode called after a frame has been coded/decoded */ |