changeset 9878:05a510cd1e3b libavcodec

Fetch timestamp for the first frame of field only if frame_offset and next_frame_offset are not set, because second field has next frame offset set but not frame_offset, otherwise this wrongly fetch timestamp for the second field.
author bcoudurier
date Sun, 21 Jun 2009 03:50:26 +0000
parents 7c769effb964
children d54ba41c7e48
files parser.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/parser.c	Sat Jun 20 14:47:38 2009 +0000
+++ b/parser.c	Sun Jun 21 03:50:26 2009 +0000
@@ -89,7 +89,8 @@
     s->offset= 0;
     for(i = 0; i < AV_PARSER_PTS_NB; i++) {
         if (   s->cur_offset + off >= s->cur_frame_offset[i]
-            &&(s->     frame_offset       <  s->cur_frame_offset[i] || !s->frame_offset)
+            && (s->frame_offset < s->cur_frame_offset[i] ||
+              (!s->frame_offset && !s->next_frame_offset)) // first field/frame
             //check is disabled  becausue mpeg-ts doesnt send complete PES packets
             && /*s->next_frame_offset + off <*/  s->cur_frame_end[i]){
             s->dts= s->cur_frame_dts[i];