FastLED 3.9.15
Loading...
Searching...
No Matches

◆ plm_demux_get_start_time()

double fl::third_party::plm_demux_get_start_time ( plm_demux_t * self,
int type )

Definition at line 1304 of file pl_mpeg.hpp.

1304 {
1305 if (self->start_time != PLM_PACKET_INVALID_TS) {
1306 return self->start_time;
1307 }
1308
1309 int previous_pos = plm_buffer_tell(self->buffer);
1310 int previous_start_code = self->start_code;
1311
1312 // Find first video PTS
1313 plm_demux_rewind(self);
1314 do {
1315 plm_packet_t *packet = plm_demux_decode(self);
1316 if (!packet) {
1317 break;
1318 }
1319 if (packet->type == type) {
1320 self->start_time = packet->pts;
1321 }
1322 } while (self->start_time == PLM_PACKET_INVALID_TS);
1323
1324 plm_demux_buffer_seek(self, previous_pos);
1325 self->start_code = previous_start_code;
1326 return self->start_time;
1327}
void plm_demux_buffer_seek(plm_demux_t *self, size_t pos) FL_NOEXCEPT
Definition pl_mpeg.hpp:1297
plm_packet_t * plm_demux_decode(plm_demux_t *self) FL_NOEXCEPT
Definition pl_mpeg.hpp:1517
void plm_demux_rewind(plm_demux_t *self) FL_NOEXCEPT
Definition pl_mpeg.hpp:1286
size_t plm_buffer_tell(plm_buffer_t *self) FL_NOEXCEPT
Definition pl_mpeg.hpp:945
#define PLM_PACKET_INVALID_TS
Definition pl_mpeg.h:171

References FL_NOEXCEPT, plm_buffer_tell(), plm_demux_buffer_seek(), plm_demux_decode(), plm_demux_rewind(), PLM_PACKET_INVALID_TS, fl::third_party::plm_packet_t::pts, and fl::third_party::plm_packet_t::type.

Referenced by plm_demux_get_duration(), plm_seek(), and plm_seek_frame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: