Revision 2c62639a src/Chunkiser/input-stream-ipb.c

View differences:

src/Chunkiser/input-stream-ipb.c
43 43
  struct log_info chunk_log;
44 44
};
45 45

  
46
static void chunk_print(FILE *log, int id, int *frames)
46
static void chunk_print(FILE *log, int id, int *frames, int type)
47 47
{
48 48
  int i = 0;
49 49

  
50
  switch (type) {
51
    case FF_I_TYPE:
52
      fprintf(log, "I");
53
      break;
54
    case FF_P_TYPE:
55
      fprintf(log, "P");
56
      break;
57
    case FF_B_TYPE:
58
      fprintf(log, "B");
59
      break;
60
    default:
61
      exit(-1);
62
  }
50 63
  fprintf(log, "Chunk %d:", id);
51 64
  while (frames[i] != -1) {
52 65
    fprintf(log, " %d", frames[i++]);
......
363 376
      fprintf(stderr, "I Frame!\n");
364 377
      result = s->i_chunk;
365 378
      *size = s->i_chunk_size;
366
      if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.i_frames);
379
      if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.i_frames, FF_I_TYPE);
367 380
      s->i_chunk = NULL;
368 381
      s->p_ready = 1;
369 382
      s->b_ready = 1;
......
385 398
        *size = s->p_chunk_size;
386 399
        s->p_chunk = NULL;
387 400
        s->p_ready = 0;
388
        if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.p_frames);
401
        if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.p_frames, FF_P_TYPE);
389 402
      }
390 403
      if (s->p_chunk == NULL) {
391 404
        s->p_chunk = malloc(VIDEO_PAYLOAD_HEADER_SIZE);
......
404 417
        *size = s->b_chunk_size;
405 418
        s->b_chunk = NULL;
406 419
        s->b_ready = 0;
407
        if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.b_frames);
420
        if (*size) chunk_print(s->chunk_log.log, id, s->chunk_log.b_frames, FF_B_TYPE);
408 421
      }
409 422
      if (s->b_chunk == NULL) {
410 423
        s->b_chunk = malloc(VIDEO_PAYLOAD_HEADER_SIZE);

Also available in: Unified diff