aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-18 11:50:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-18 12:00:17 +0200
commit66722b4ba955eebef77045644a082505cfa134fa (patch)
tree30cd0c4af5bbca39a51c48a3038d96c13ca28d9e /libavcodec
parent338f8b2eaf36f078eb5cc26ac10e651dc4c48243 (diff)
parentc34a96a5ddfa390ce2a352eca79190766c9056d4 (diff)
downloadffmpeg-66722b4ba955eebef77045644a082505cfa134fa.tar.gz
Merge commit 'c34a96a5ddfa390ce2a352eca79190766c9056d4'
* commit 'c34a96a5ddfa390ce2a352eca79190766c9056d4': dxa: fix decoding of first I-frame by separating I/P-frame decoding Conflicts: libavcodec/dxa.c See: 186e47ef6d7d90bfd8b16e77cfa5e7aeb2a497c0 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dxa.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 0c90264e0d..36fef90996 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -263,18 +263,26 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
}
break;
case 2:
- case 3:
case 4:
+ frame->key_frame = 1;
+ frame->pict_type = AV_PICTURE_TYPE_I;
+ for (j = 0; j < avctx->height; j++) {
+ memcpy(outptr, srcptr, avctx->width);
+ outptr += stride;
+ srcptr += avctx->width;
+ }
+ break;
+ case 3:
case 5:
- if (!tmpptr && (compr & 1)) {
+ if (!tmpptr) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
if (!(avctx->flags2 & CODEC_FLAG2_SHOW_ALL))
return AVERROR_INVALIDDATA;
}
- frame->key_frame = !(compr & 1);
- frame->pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
- for(j = 0; j < avctx->height; j++){
- if((compr & 1) && tmpptr){
+ frame->key_frame = 0;
+ frame->pict_type = AV_PICTURE_TYPE_P;
+ for (j = 0; j < avctx->height; j++) {
+ if(tmpptr){
for(i = 0; i < avctx->width; i++)
outptr[i] = srcptr[i] ^ tmpptr[i];
tmpptr += stride;