]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
use ff_parse_pes_pts for parsing an MPEG-PES timestamp
authorivo <ivo@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 7 Jan 2008 23:38:12 +0000 (23:38 +0000)
committerivo <ivo@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 7 Jan 2008 23:38:12 +0000 (23:38 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11452 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/pva.c

index 8874db82c8152a717853a4b5cb33a3078678e060..0205675de05ce8595f0d70013061d3b219fe1eb0 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "avformat.h"
+#include "mpeg.h"
 
 #define PVA_MAX_PAYLOAD_LENGTH  0x17f8
 #define PVA_VIDEO_PAYLOAD       0x01
@@ -125,11 +126,8 @@ recover:
 
             pvactx->continue_pes = pes_packet_length;
 
-            if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
-                pva_pts  = ((long long) *pes_header_data & 0x0e) << 29;
-                pva_pts += (AV_RB16(pes_header_data+1) >> 1) << 15;
-                pva_pts +=  AV_RB16(pes_header_data+3) >> 1;
-            }
+            if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20)
+                pva_pts = ff_parse_pes_pts(pes_header_data);
         }
 
         pvactx->continue_pes -= length;