summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-05-02 00:46:03 +0300
committerUoti Urpala <uau@mplayer2.org>2011-05-02 00:46:03 +0300
commit7e65428712beacd416dc3410c52f22ebfd3b4c53 (patch)
tree79bb2f4388be7031b5505c7745e1a59aff6cff56 /libmpcodecs/vd_ffmpeg.c
parent5c4b059f1608f6d6a981b7d81a14f1c46e40ba52 (diff)
parentd0376729d171a6c0b4cc15928c168f68adefbaa6 (diff)
downloadmpv-7e65428712beacd416dc3410c52f22ebfd3b4c53.tar.bz2
mpv-7e65428712beacd416dc3410c52f22ebfd3b4c53.tar.xz
Merge branch 'mplayer1_changes'
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 431b5cd340..598be093c1 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -521,10 +521,13 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
sh_video_t *sh = avctx->opaque;
vd_ffmpeg_ctx *ctx = sh->context;
mp_image_t *mpi=NULL;
- int flags= MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE;
+ int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE;
int type= MP_IMGTYPE_IPB;
int width= avctx->width;
int height= avctx->height;
+ // special case to handle reget_buffer without buffer hints
+ if (pic->opaque && pic->data[0] && !pic->buffer_hints)
+ return 0;
avcodec_align_dimensions(avctx, &width, &height);
//printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count);
@@ -557,6 +560,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
if(init_vo(sh, avctx->pix_fmt) < 0){
avctx->release_buffer= avcodec_default_release_buffer;
avctx->get_buffer= avcodec_default_get_buffer;
+ avctx->reget_buffer= avcodec_default_reget_buffer;
+ if (pic->data[0])
+ release_buffer(avctx, pic);
return avctx->get_buffer(avctx, pic);
}
@@ -569,6 +575,9 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
ctx->do_dr1=0; //FIXME
avctx->get_buffer= avcodec_default_get_buffer;
+ avctx->reget_buffer= avcodec_default_reget_buffer;
+ if (pic->data[0])
+ release_buffer(avctx, pic);
return avctx->get_buffer(avctx, pic);
}