aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-03-30 20:46:46 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-03-30 20:46:46 +0000
commitc28112fab65f95d913ad98ad5998919674239c61 (patch)
tree5d23124f84298407224c09321f88cec2df8ac242 /libavcodec
parentaa1de0d9ed2bf135f9878995a3e909c4777bba52 (diff)
downloadffmpeg-c28112fab65f95d913ad98ad5998919674239c61.tar.gz
Make sure the EC code does not attempt to use inter based concealment if there
is no reference frame available. (this can happen because the EC code will attempt to use reference frames even for I/IDR frames) Originally committed as revision 22732 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/error_resilience.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index fffe19cca3..a7ae0438cd 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -629,6 +629,12 @@ static int is_intra_more_likely(MpegEncContext *s){
undamaged_count++;
}
+ if(s->codec_id == CODEC_ID_H264){
+ H264Context *h= (void*)s;
+ if(h->ref_count[0] <= 0 || !h->ref_list[0][0].data[0])
+ return 1;
+ }
+
if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction
//prevent dsp.sad() check, that requires access to the image