30 #define DSS_HEAD_OFFSET_AUTHOR 0xc
31 #define DSS_AUTHOR_SIZE 16
33 #define DSS_HEAD_OFFSET_START_TIME 0x26
34 #define DSS_HEAD_OFFSET_END_TIME 0x32
35 #define DSS_TIME_SIZE 12
37 #define DSS_HEAD_OFFSET_ACODEC 0x2a4
38 #define DSS_ACODEC_DSS_SP 0x0
39 #define DSS_ACODEC_G723_1 0x2
41 #define DSS_HEAD_OFFSET_COMMENT 0x31e
42 #define DSS_COMMENT_SIZE 64
44 #define DSS_BLOCK_SIZE 512
45 #define DSS_HEADER_SIZE (DSS_BLOCK_SIZE * 2)
46 #define DSS_AUDIO_BLOCK_HEADER_SIZE 6
47 #define DSS_FRAME_SIZE 42
74 int y, month, d, h, minute, sec;
83 if (sscanf(
string,
"%2d%2d%2d%2d%2d%2d", &y, &month, &d, &h, &minute, &sec) != 6)
87 snprintf(datetime,
sizeof(datetime),
"%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
88 y + 2000, month, d, h, minute, sec);
93 unsigned int size,
const char *key)
198 for (i = 0; i < DSS_FRAME_SIZE - 2; i += 2)
216 int read_size,
ret,
offset = 0, buff_offset = 0;
241 int size2 = ctx->
counter + read_size;
245 if (ret < size2 - offset)
254 if (ret < read_size - offset)
264 if (pkt->
data[0] == 0xff)
311 if (ret < size2 - offset) {
321 if (ret < size - offset) {
349 int64_t timestamp,
int flags)
357 seekto = timestamp / 264 * 41 / 506 * 512;
359 seekto = timestamp / 240 * ctx->
packet_size / 506 * 512;
371 ctx->
swap = !!(header[0] & 0x80);
372 offset = 2*header[1] + 2*ctx->
swap;