Export op_current_link
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 18 Feb 2017 15:49:24 +0000 (17:49 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 18 Feb 2017 15:51:58 +0000 (17:51 +0200)
Opusfile.xs
lib/Audio/Opusfile.pm

index 40037e1bb73ec46b5875b767941047041d0456cc..243795f60cf7d4904ff5bdb46bfb5e3bb7223d84 100644 (file)
@@ -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)
index a6bbc4751e47f78a72df63a33acf8d70c7751248..f5a1365fc48f405bcc264077c21319a8b1b8d026 100644 (file)
@@ -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<current_link>
+
+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<bitrate>([I<$link_index>])
 
 Computes the bitrate of the stream (with no arguments), or of an
This page took 0.012748 seconds and 4 git commands to generate.