summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 30fb0faf07..c2c8f13d4d 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -907,8 +907,13 @@ alloc:
pic= (AVFrame*)&s->picture[i];
}
- pic->reference= (s->pict_type != B_TYPE || s->codec_id == CODEC_ID_H264)
- && !s->dropable ? 3 : 0;
+ pic->reference= 0;
+ if (!s->dropable){
+ if (s->codec_id == CODEC_ID_H264)
+ pic->reference = s->picture_structure;
+ else if (s->pict_type != B_TYPE)
+ pic->reference = 3;
+ }
pic->coded_picture_number= s->coded_picture_number++;