external/libwebmdec/src/open-callbacks.c
static int init_audio_decoder(webmdec_t *handle)
{
    const int codec =
        nestegg_track_codec_id(handle->demuxer, handle->audio_track);
    if (codec != NESTEGG_CODEC_VORBIS) {
        return 0;  /* Not supported. */
    }

    unsigned int header_count;
    if (nestegg_track_codec_data_count(handle->demuxer, handle->audio_track,
                                       &header_count) != 0) {
        header_count = 0;
    }
    if (header_count != 3) {  /* Vorbis has 3 header packets. */
        return 0;
    }
    unsigned char *id_data, *setup_data;
    size_t id_length, setup_length;
    if (nestegg_track_codec_data(handle->demuxer, handle->audio_track, 0,
                                 &id_data, &id_length) != 0) {
        return 0;
    }
    if (nestegg_track_codec_data(handle->demuxer, handle->audio_track, 2,
                                 &setup_data, &setup_length) != 0) {
        return 0;
    }

    handle->audio_decoder = vorbis_decoder_create(
        id_data, id_length, setup_data, setup_length);
    return handle->audio_decoder != NULL;
}
/**
 * init_audio_decoder:  Create a audio decoder for the given stream,
 * returning whether the creation succeeded.
 */
Create a audio decoder for the given stream,
returning whether the creation succeeded.
Create a audio decoder for the given stream returning whether the creation succeeded .
static int init_audio_decoder(webmdec_t *handle)
{
    const int codec =
        nestegg_track_codec_id(handle->demuxer, handle->audio_track);
    if (codec != NESTEGG_CODEC_VORBIS) {
        return 0;  
    }
    unsigned int header_count;
    if (nestegg_track_codec_data_count(handle->demuxer, handle->audio_track,
                                       &header_count) != 0) {
        header_count = 0;
    }
    if (header_count != 3) {  
        return 0;
    }
    unsigned char *id_data, *setup_data;
    size_t id_length, setup_length;
    if (nestegg_track_codec_data(handle->demuxer, handle->audio_track, 0,
                                 &id_data, &id_length) != 0) {
        return 0;
    }
    if (nestegg_track_codec_data(handle->demuxer, handle->audio_track, 2,
                                 &setup_data, &setup_length) != 0) {
        return 0;
    }
    handle->audio_decoder = vorbis_decoder_create(
        id_data, id_length, setup_data, setup_length);
    return handle->audio_decoder != NULL;
}
static int init_audio_decoder ( webmdec_t * handle ) { const int codec = nestegg_track_codec_id ( handle -> demuxer , handle -> audio_track ) ; if ( codec != NESTEGG_CODEC_VORBIS ) { return 0 ; } unsigned int header_count ; if ( nestegg_track_codec_data_count ( handle -> demuxer , handle -> audio_track , & header_count ) != 0 ) { header_count = 0 ; } if ( header_count != 3 ) { return 0 ; } unsigned char * id_data , * setup_data ; size_t id_length , setup_length ; if ( nestegg_track_codec_data ( handle -> demuxer , handle -> audio_track , 0 , & id_data , & id_length ) != 0 ) { return 0 ; } if ( nestegg_track_codec_data ( handle -> demuxer , handle -> audio_track , 2 , & setup_data , & setup_length ) != 0 ) { return 0 ; } handle -> audio_decoder = vorbis_decoder_create ( id_data , id_length , setup_data , setup_length ) ; return handle -> audio_decoder != NULL ; }
init_audio_decoder:  Create a audio decoder for the given stream,
 returning whether the creation succeeded.
init_audio_decoder : Create a audio decoder for the given stream returning whether the creation succeeded .
/* Not supported. */ /* Vorbis has 3 header packets. */