Browse Source

Merge remote-tracking branch 'qatar/release/0.5' into release/0.5

* qatar/release/0.5:
  mpeg12: do not decode extradata more than once.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.5.11
Michael Niedermayer 13 years ago
parent
commit
deaaacbc3f
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/mpeg12.c

+ 4
- 1
libavcodec/mpeg12.c View File

@@ -1163,6 +1163,7 @@ typedef struct Mpeg1Context {
int save_width, save_height;
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator

int extradata_decoded;
} Mpeg1Context;

static av_cold int mpeg_decode_init(AVCodecContext *avctx)
@@ -2299,8 +2300,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,

s->slice_count= 0;

if(avctx->extradata && !avctx->frame_number)
if (avctx->extradata && !s->extradata_decoded) {
decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size);
s->extradata_decoded = 1;
}

return decode_chunks(avctx, picture, data_size, buf, buf_size);
}


Loading…
Cancel
Save