Skip to content
Snippets Groups Projects
Commit e1ee9862 authored by Petter Reinholdtsen's avatar Petter Reinholdtsen
Browse files

Use correct oggz argument type in examples.

The examples using oggz must use oggz_package as the
second argument to read_package for the callback to be acceptable by
oggz_set_read_callback().  Adjust the method signature to use
oggz_package and extract the required ogg_package members from this
one to avoid compiler message like this:

fishsound-identify.c: In function ‘main’:
fishsound-identify.c:101:37: warning: passing argument 3 of ‘oggz_set_read_callback’ from incompatible pointer type [-Wincompatible-pointer-types]
  101 |   oggz_set_read_callback (oggz, -1, read_packet, NULL);
      |                                     ^~~~~~~~~~~
      |                                     |
      |                                     int (*)(OGGZ *, ogg_packet *, long int,  void *) {aka int (*)(void *, ogg_packet *, long int,  void *)}
In file included from /usr/include/oggz/oggz.h:576,
                 from fishsound-identify.c:39:
/usr/include/oggz/oggz_read.h:109:44: note: expected ‘OggzReadPacket’ {aka ‘int (*)(void *, oggz_packet *, long int,  void *)’} but argument is of type ‘int (*)(OGGZ *, ogg_packet *, long int,  void *)’ {aka ‘int (*)(void *, ogg_packet *, long int,  void *)’}
  109 |                             OggzReadPacket read_packet, void * user_data);
      |                             ~~~~~~~~~~~~~~~^~~~~~~~~~~

Fixes #13
parent 5115cc7a
No related branches found
No related tags found
1 merge request!4Use correct oggz argument type in examples.
Pipeline #5798 failed
......@@ -129,9 +129,10 @@ decoded (FishSound * fsound, float ** pcm, long frames, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
{
FS_DecEnc * ed = (FS_DecEnc *) user_data;
ogg_packet *op = &ozp->op;
fish_sound_prepare_truncation (ed->decoder, op->granulepos, op->e_o_s);
fish_sound_decode (ed->decoder, op->packet, op->bytes);
......
......@@ -82,9 +82,10 @@ decoded_float (FishSound * fsound, float ** pcm, long frames, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
{
FishSound * fsound = (FishSound *)user_data;
ogg_packet *op = &ozp->op;
/* If we have not yet selected an audio track to decode, then try
* to identify this one. If it is a known audio codec, then remember its
......
......@@ -60,9 +60,9 @@ dump_identity (unsigned char * buf, long bytes)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
{
ogg_packet *op = &ozp->op;
if (op->bytes < 8) {
printf ("too short\n");
} else {
......
......@@ -76,8 +76,9 @@ decoded (FishSound * fsound, float ** pcm, long frames, void * user_data)
}
static int
read_packet (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
read_packet (OGGZ * oggz, oggz_packet * ozp, long serialno, void * user_data)
{
ogg_packet *op = &ozp->op;
FishSound * fsound = (FishSound *)user_data;
if (op->e_o_s) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment