Revision 74ff12bb input-stream-dummy.c

View differences:

input-stream-dummy.c
27 27
uint8_t *chunkise(struct input_stream *dummy, int id, int *size, uint64_t *ts)
28 28
{
29 29
  uint8_t *res;
30
  const int header_size = 1 + 2 + 2 + 1 + 2; // 1 Frame type + 2 width + 2 height + 1 number of frames + 2 frame len
30
  const int header_size = 1 + 2 + 2 + 2 + 2 + 1; // 1 Frame type + 2 width + 2 height + 2 frame rate num + 2 frame rate den + 1 number of frames
31 31
  static char buff[80];
32 32

  
33 33
  sprintf(buff, "Chunk %d", id);
34 34
  *ts = 40 * id * 1000;
35
  *size = strlen(buff) + 1 + header_size;
35
  *size = strlen(buff) + 1 + header_size + 2;
36 36
  res = malloc(*size);
37 37
  res[0] = 1;
38 38
  res[1] = 352 >> 8;
39 39
  res[2] = 352 & 0xFF;
40 40
  res[3] = 288 >> 8;
41 41
  res[4] = 288 & 0xFF;
42
  res[5] = 1;
43
  res[6] = (*size - header_size) >> 8;
44
  res[7] = (*size - header_size) & 0xFF;
45
  memcpy(res + header_size, buff, *size - header_size);
42
  res[5] = 0;
43
  res[6] = 1;
44
  res[7] = 0;
45
  res[8] = 25;
46
  res[9] = 1;
47
  res[10] = (*size - header_size - 2) >> 8;
48
  res[11] = (*size - header_size - 2) & 0xFF;
49
  memcpy(res + header_size + 2, buff, *size - header_size - 2);
46 50

  
47 51
  return res;
48 52
}

Also available in: Unified diff