X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh.c;h=a6120be28bfcf8bfb581cc1fb37a8f37776a2533;hp=2837db61c7de43a732564c8d46fec14ef6b4331e;hb=081c8921f827c1ed482c45ba22bd8bb97db2838b;hpb=f0c195e0ee6baefae0046db0e10df2e45f72ca41 diff --git a/ogg_afh.c b/ogg_afh.c index 2837db61..a6120be2 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Andre Noll + * Copyright (C) 2004-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -105,7 +105,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 +115,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); @@ -129,10 +128,8 @@ static int vorbis_get_header_callback(ogg_packet *packet, int packet_num, ret = -E_OGG_PACKET_IN; if (ogg_stream_packetin(&vghd->os, packet) < 0) goto out; - ret = -E_OGG_STREAM_FLUSH; - if (ogg_stream_flush(&vghd->os, &og) == 0) - goto out; - add_ogg_page(&og, vghd); + while (ogg_stream_flush(&vghd->os, &og)) + add_ogg_page(&og, vghd); ret = 0; out: ogg_stream_clear(&vghd->os);