Commit 11b68168 authored by Michael Niedermayer's avatar Michael Niedermayer

decoders should (IMHO) not duplicate frames, the application can do this if it wants

Originally committed as revision 5355 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bfc2a19d
...@@ -6900,7 +6900,7 @@ static int decode_slice(H264Context *h){ ...@@ -6900,7 +6900,7 @@ static int decode_slice(H264Context *h){
eos = get_cabac_terminate( &h->cabac ); eos = get_cabac_terminate( &h->cabac );
if( ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 1) { if( ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 1) {
av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y); av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d, bytestream (%d)\n", s->mb_x, s->mb_y, h->cabac.bytestream_end - h->cabac.bytestream);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask); ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
return -1; return -1;
} }
...@@ -7786,7 +7786,6 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -7786,7 +7786,6 @@ static int decode_frame(AVCodecContext *avctx,
int pics = 0; int pics = 0;
int out_of_order; int out_of_order;
int cross_idr = 0; int cross_idr = 0;
int dropped_frame = 0;
int i; int i;
if(h->sps.bitstream_restriction_flag if(h->sps.bitstream_restriction_flag
...@@ -7829,12 +7828,11 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -7829,12 +7828,11 @@ static int decode_frame(AVCodecContext *avctx,
out = prev; out = prev;
if(out_of_order || pics > s->avctx->has_b_frames){ if(out_of_order || pics > s->avctx->has_b_frames){
dropped_frame = (out != h->delayed_pic[out_idx]);
for(i=out_idx; h->delayed_pic[i]; i++) for(i=out_idx; h->delayed_pic[i]; i++)
h->delayed_pic[i] = h->delayed_pic[i+1]; h->delayed_pic[i] = h->delayed_pic[i+1];
} }
if(prev == out && !dropped_frame) if(prev == out)
*data_size = 0; *data_size = 0;
else else
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment