changeset 11557:53822d92c3f7 libavcodec

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)
author michael
date Tue, 30 Mar 2010 20:46:46 +0000
parents b94e1810ce4c
children 44c5c540722c
files error_resilience.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/error_resilience.c	Tue Mar 30 15:50:57 2010 +0000
+++ b/error_resilience.c	Tue Mar 30 20:46:46 2010 +0000
@@ -629,6 +629,12 @@
             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