From: Marius Gavrilescu Date: Sat, 18 Feb 2017 15:49:24 +0000 (+0200) Subject: Export op_current_link X-Git-Tag: 0.005001~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=9fc88b294214d5944b6bb5076528f7dd427d6e0c;p=audio-opusfile.git Export op_current_link --- diff --git a/Opusfile.xs b/Opusfile.xs index 40037e1..243795f 100644 --- a/Opusfile.xs +++ b/Opusfile.xs @@ -81,11 +81,17 @@ long op_raw_total(of, li = -1) Audio::Opusfile of; int li; +POSTCALL: + if(RETVAL < 0) + croak("op_current_link returned error %ld\n", RETVAL); long op_pcm_total(of, li = -1) Audio::Opusfile of; int li; +POSTCALL: + if(RETVAL < 0) + croak("op_current_link returned error %ld\n", RETVAL); Audio::Opusfile::Head op_head(of, li = -1) @@ -97,12 +103,20 @@ op_tags(of, li = -1) Audio::Opusfile of; int li; -# op_current_link not exported until we export the decoding API +int +op_current_link(of) + Audio::Opusfile of; +POSTCALL: + if(RETVAL < 0) + croak("op_current_link returned error %ld\n", RETVAL); int op_bitrate(of, li = -1) Audio::Opusfile of; int li; +POSTCALL: + if(RETVAL < 0) + croak("op_bitrate returned error %ld\n", RETVAL); long op_bitrate_instant(of) diff --git a/lib/Audio/Opusfile.pm b/lib/Audio/Opusfile.pm index a6bbc47..f5a1365 100644 --- a/lib/Audio/Opusfile.pm +++ b/lib/Audio/Opusfile.pm @@ -206,6 +206,15 @@ separate function to convert this to seconds. The stream must be seekable to get the total. A negative value is returned if the stream is not seekable. +=item $of->B + +Retrieve the index of the current link. + +This is the link that produced the data most recently read by +op_read_float() or its associated functions, or, after a seek, the +link that the seek target landed in. Reading more data may advance the +link index (even on the first read after a seek). + =item $of->B([I<$link_index>]) Computes the bitrate of the stream (with no arguments), or of an