X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh.c;h=9dfb028d0a2f9e14dac54cbc5a4ca200cd2dcf6b;hp=144a2690bf80da24d298ab2bb56c5403835157dc;hb=9aa1f3d69c0aa335b3026581defbc09eb2c4efb4;hpb=1c8226eae0e976d940366cd10bd708d8e4d0bca5 diff --git a/ogg_afh.c b/ogg_afh.c index 144a2690..9dfb028d 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Andre Noll + * Copyright (C) 2004 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -20,6 +20,20 @@ struct private_vorbis_data { vorbis_comment vc; }; +/* + * Vorbis uses three header packets, all of which are required: the + * identification header, the comments header, and the setup header. + * + * The identification header identifies the bitstream as Vorbis. It contains + * the Vorbis version and simple audio characteristics of the stream such as + * sample rate and number of channels. + * + * The comment header includes user text comments (tags) and a vendor string + * for the application/library that produced the bitstream. + * + * The setup header includes extensive CODEC setup information as well as the + * complete VQ and Huffman codebooks needed for decoding. + */ static int vorbis_packet_callback(ogg_packet *packet, int packet_num, __a_unused int serial, struct afh_info *afhi, void *private_data) { @@ -105,7 +119,6 @@ static int vorbis_get_header_callback(ogg_packet *packet, int packet_num, return 0; if (packet_num == 0) { ogg_stream_init(&vghd->os, serial); - ret = -E_OGG_PACKET_IN; ret = ogg_stream_packetin(&vghd->os, packet); if (ret < 0) goto out; @@ -116,8 +129,8 @@ static int vorbis_get_header_callback(ogg_packet *packet, int packet_num, return 1; } if (packet_num == 1) { - PARA_INFO_LOG("replacing metadata packet\n"); ogg_packet replacement = *packet; + PARA_INFO_LOG("replacing metadata packet\n"); replacement.packet = dummy_packet; replacement.bytes = sizeof(dummy_packet); ret = ogg_stream_packetin(&vghd->os, &replacement);