Example #1
0
static int
read_packet (OGGZ * oggz, oggz_packet * zp, long serialno, void * user_data)
{
  ogg_packet * op = &zp->op;
  int granuleshift;

  granuleshift = oggz_get_granuleshift (oggz, serialno);

  printf ("%010lu: op->granulepos: ", serialno);
  print_granulepos (op->granulepos, granuleshift);
  printf ("  oggz_tell_granulepos(): ");
  print_granulepos (oggz_tell_granulepos (oggz), granuleshift);

  if (op->b_o_s) {
    printf (" *** bos");
  }

  if (op->e_o_s) {
    got_an_eos = 1;
    printf (" *** eos");
  }

  printf ("\n");

  return 0;
}
static int
read_page_normal (OGGZ * ap_oggz, const ogg_page * ap_og, long a_serialno,
                  void * ap_user_data)
{
  oggdmux_prc_t * p_prc = ap_user_data;
  TIZ_DEBUG (handleOf (p_prc), "serialno = [%d] : granule pos [%lld]",
             a_serialno, oggz_tell_granulepos (ap_oggz));
  return OGGZ_CONTINUE;
}
Example #3
0
static float calc_keyframe_timestamp(oggz_packet *packet, long serialno)
{
	ogg_int64_t granulepos = oggz_tell_granulepos(oggz);

	int granuleshift = oggz_get_granuleshift(oggz, serialno);

	ogg_int64_t granulerate_n = 0;
	ogg_int64_t granulerate_d = 0;
	oggz_get_granulerate(oggz, serialno, &granulerate_n, &granulerate_d);

	return (float)(granulepos >> granuleshift) * (float)granulerate_d / (float)granulerate_n;
}