diff h264_parser.c @ 9000:78afc2990d00 libavcodec

Use context variable repeat_pict for frame duration computation and document this new use. Patch by Ivan Schreter, schreter gmx net
author cehoyos
date Sat, 21 Feb 2009 20:11:47 +0000
parents f701dab6a62d
children d22ed7aad1b0
line wrap: on
line diff
--- a/h264_parser.c	Sat Feb 21 20:03:05 2009 +0000
+++ b/h264_parser.c	Sat Feb 21 20:11:47 2009 +0000
@@ -192,6 +192,35 @@
                 }
             }
 
+            if(h->sps.pic_struct_present_flag) {
+                switch (h->sei_pic_struct) {
+                    case SEI_PIC_STRUCT_TOP_FIELD:
+                    case SEI_PIC_STRUCT_BOTTOM_FIELD:
+                        s->repeat_pict = -1;
+                        break;
+                    case SEI_PIC_STRUCT_FRAME:
+                    case SEI_PIC_STRUCT_TOP_BOTTOM:
+                    case SEI_PIC_STRUCT_BOTTOM_TOP:
+                        s->repeat_pict = 0;
+                        break;
+                    case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
+                    case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
+                        s->repeat_pict = 1;
+                        break;
+                    case SEI_PIC_STRUCT_FRAME_DOUBLING:
+                        s->repeat_pict = 2;
+                        break;
+                    case SEI_PIC_STRUCT_FRAME_TRIPLING:
+                        s->repeat_pict = 4;
+                        break;
+                    default:
+                        s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1;
+                        break;
+                }
+            } else {
+                s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1;
+            }
+
             return 0; /* no need to evaluate the rest */
         }
         buf += consumed;