summaryrefslogtreecommitdiff
path: root/libavcodec/cavs.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-19 14:55:07 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-19 15:44:59 +0100
commit642a655f7d9a6afc97fff5f3ecd6a7ad5d53e0ca (patch)
treeb09ea65812ccdada345d88802afa71016e1b357e /libavcodec/cavs.c
parente84194f06024892fc33684c5a1726c97a0c0a45c (diff)
parentf1d8763a02b5fce9a7d9789e049d74a45b15e1e8 (diff)
Merge commit 'f1d8763a02b5fce9a7d9789e049d74a45b15e1e8'
* commit 'f1d8763a02b5fce9a7d9789e049d74a45b15e1e8': mpegvideo: allocate scratch buffers after linesize is known Conflicts: libavcodec/mpegvideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cavs.c')
-rw-r--r--libavcodec/cavs.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 65e12dd174..21660751b5 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -655,7 +655,9 @@ int ff_cavs_next_mb(AVSContext *h) {
*
****************************************************************************/
-void ff_cavs_init_pic(AVSContext *h) {
+int ff_cavs_init_pic(AVSContext *h) {
+ MpegEncContext *s = &h->s;
+ int ret;
int i;
/* clear some predictors */
@@ -675,6 +677,14 @@ void ff_cavs_init_pic(AVSContext *h) {
h->luma_scan[3] = 8*h->l_stride+8;
h->mbx = h->mby = h->mbidx = 0;
h->flags = 0;
+
+ if (!s->edge_emu_buffer &&
+ (ret = ff_mpv_frame_size_alloc(s, h->picture.f.linesize[0])) < 0) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "get_buffer() failed to allocate context scratch buffers.\n");
+ return ret;
+ }
+ return 0;
}
/*****************************************************************************