Revision 812005f2

View differences:

Chunker/chunker.c
30 30
  double i_max_time = 0, p_max_time = 0, b_max_time = 0;
31 31
  int igops=0;
32 32

  
33
  int i_chunk_frame[50], b_chunk_frame[50], p_chunk_frame[50];
33 34
  for (i = 0; i < n; i++) {
34
    int i_chunk_frame[50], b_chunk_frame[50], p_chunk_frame[50];
35 35

  
36 36
    switch (ftypes[i]) {
37 37
      case 1:
38 38
        /* I Type */
39 39
        if (igops == ngops) {
40
          if (i_chunk_dimension) {
41
            print_chunk(chunk_id++, i_chunk_frame, i_chunk_dimension, i_min_time, i_max_time, i_chunk_size, 3);
42
          }
40 43
          if (p_chunk_dimension) {
41 44
            print_chunk(chunk_id++, p_chunk_frame, p_chunk_dimension, p_min_time, p_max_time, p_chunk_size, 2);
42 45
          }
43 46
          if (b_chunk_dimension) {
44 47
            print_chunk(chunk_id++, b_chunk_frame, b_chunk_dimension, b_min_time, b_max_time, b_chunk_size, 1);
45 48
          }
46
          if (i_chunk_dimension) {
47
            print_chunk(chunk_id++, i_chunk_frame, i_chunk_dimension, i_min_time, i_max_time, i_chunk_size, 3);
48
          }
49 49
          i_chunk_size = p_chunk_size = b_chunk_size = 0;
50 50
          i_chunk_dimension = p_chunk_dimension = b_chunk_dimension = 0;
51 51
          i_min_time = p_min_time = b_min_time = DBL_MAX;
......
73 73
        b_max_time = b_max_time>ftimes[i] ? b_max_time : ftimes[i];
74 74
        break;
75 75
      default:
76
        return;
76
        i=n; //TODO: check what frame type=0 means
77 77
    }
78 78
  }
79
  if (i_chunk_dimension) {
80
    print_chunk(chunk_id++, i_chunk_frame, i_chunk_dimension, i_min_time, i_max_time, i_chunk_size, 3);
81
  }
82
  if (p_chunk_dimension) {
83
    print_chunk(chunk_id++, p_chunk_frame, p_chunk_dimension, p_min_time, p_max_time, p_chunk_size, 2);
84
  }
85
  if (b_chunk_dimension) {
86
    print_chunk(chunk_id++, b_chunk_frame, b_chunk_dimension, b_min_time, b_max_time, b_chunk_size, 1);
87
  }
79 88
}
80 89

  
81 90
void chunkise_gop(int n, int ngops)
......
87 96
  double max_time = 0;
88 97
  int igops=0;
89 98

  
99
  int chunk_frame[150];
90 100
  for (i = 0; i < n; i++) {
91
    int chunk_frame[150];
92 101

  
93 102
    if (ftypes[i] == 1) {
94 103
      /* I Type */
......
109 118
    min_time = min_time<ftimes[i] ? min_time : ftimes[i];
110 119
    max_time = max_time>ftimes[i] ? max_time : ftimes[i];
111 120
  }
121
  if (chunk_dimension) {
122
    print_chunk(chunk_id++, chunk_frame, chunk_dimension, min_time, max_time, chunk_size, 1);
123
  }
112 124
}
113 125

  
114 126
int frames(const char* sfile){

Also available in: Unified diff