Class: Ariblib::TimeOffsetTable
- Inherits:
-
ProgramSpecificInformation
- Object
- ProgramSpecificInformation
- Ariblib::TimeOffsetTable
- Defined in:
- lib/ariblib/ProgramSpecificInformation.rb
Overview
< 1Kbyte
Instance Attribute Summary
Attributes inherited from ProgramSpecificInformation
Instance Method Summary collapse
Methods inherited from ProgramSpecificInformation
#arib_to_utf8, #descriptor, #init_buf, #initialize, #set, #set_buf
Constructor Details
This class inherits a constructor from Ariblib::ProgramSpecificInformation
Instance Method Details
#parse_buf ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/ariblib/ProgramSpecificInformation.rb', line 231 def parse_buf ret=nil bs=BitStream.new(@buf) table_id =bs.read 8 #uimsbf section_syntax_indicator =bs.read 1 #bslbf reserved_future_use =bs.read 1 #bslbf reserved =bs.read 2 #bslbf section_length =bs.read 12 #uimsbf jst_time =bs.read 40 #bslbf if table_id == 0x73 reserved =bs.read 4 #bslbf descriptors_loop_length =bs.read 12 #uimsbf desc=descriptor(bs,descriptors_loop_length) ret=[jst_time,desc] else ret=[jst_time] end cCRC_32 =bs.read 32 #rpchof ret end |
#to_datetime(n = 0) ⇒ Object
251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/ariblib/ProgramSpecificInformation.rb', line 251 def to_datetime(n=0) dat=@contents[n] return nil unless dat jst=dat[0] sec1 =(jst>> 0)&0x0f sec10 =(jst>> 4)&0x0f min1 =(jst>> 8)&0x0f min10 =(jst>>12)&0x0f hour1 =(jst>>16)&0x0f hour10=(jst>>20)&0x0f mjd =(jst>>24)+2400001 return DateTime.jd(mjd,hour10*10+hour1,min10*10+min1,sec10*10+sec1)#+Rational(1,24*60) end |