File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
mythtv/libs/libmythtv/mpeg Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,29 @@ class PESPacket
191191 // / 1 bit Extension flags are present
192192 bool HasExtensionFlags () const { return _pesdata[4 ] & 0x1 ; }
193193
194+ // / Presentation Time Stamp, present if HasPTS() is true
195+ uint64_t PTS (void ) const
196+ {
197+ int i = 6 ;
198+ return
199+ (uint64_t (_pesdata[i+0 ] & 0x0e ) << 29 ) |
200+ (uint64_t (_pesdata[i+1 ] ) << 22 ) |
201+ (uint64_t (_pesdata[i+2 ] & 0xfe ) << 14 ) |
202+ (uint64_t (_pesdata[i+3 ] ) << 7 ) |
203+ (uint64_t (_pesdata[i+4 ] & 0xfe ) >> 1 );
204+ }
205+ // / Decode Time Stamp, present if HasDTS() is true
206+ uint64_t DTS (void ) const
207+ {
208+ int i = 6 +5 ;
209+ return
210+ (uint64_t (_pesdata[i+0 ] & 0x0e ) << 29 ) |
211+ (uint64_t (_pesdata[i+1 ] ) << 22 ) |
212+ (uint64_t (_pesdata[i+2 ] & 0xfe ) << 14 ) |
213+ (uint64_t (_pesdata[i+3 ] ) << 7 ) |
214+ (uint64_t (_pesdata[i+4 ] & 0xfe ) >> 1 );
215+ }
216+
194217 // 8 bits PES Header Length
195218 // variable length -- pes header fields
196219 // variable length -- pes data block
You can’t perform that action at this time.
0 commit comments