# HG changeset patch # User ivo # Date 1199749092 0 # Node ID b548dfced05b7b8d22611e8fe1767a687286a938 # Parent e5dfe3c96f3b77fad2fe13b67f503a339418aaf9 use ff_parse_pes_pts for parsing an MPEG-PES timestamp diff -r e5dfe3c96f3b -r b548dfced05b pva.c --- a/pva.c Mon Jan 07 23:32:57 2008 +0000 +++ b/pva.c Mon Jan 07 23:38:12 2008 +0000 @@ -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 @@ 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;