diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-12-04 14:13:46 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-12-04 15:17:43 -0500 |
commit | 512d849c24b3ae708fb15c86a047c56d2591ab46 (patch) | |
tree | 1b728c2b1502dbb0521bf9a6af1e7eeba15fe8f1 /src/opus_decoder.c | |
parent | a5bd4409319614f166a83934baddceed7e6c58b4 (diff) | |
download | opus-512d849c24b3ae708fb15c86a047c56d2591ab46.tar.gz |
Implements OPUS_GET_LAST_FRAME_DURATION decoder ctl()
Diffstat (limited to 'src/opus_decoder.c')
-rw-r--r-- | src/opus_decoder.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 015ae17a..67e8cdb5 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -64,6 +64,7 @@ struct OpusDecoder { int prev_mode; int frame_size; int prev_redundancy; + int last_packet_duration; opus_uint32 rangeFinal; }; @@ -813,6 +814,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data, } if (packet_offset != NULL) *packet_offset = tot_offset; + st->last_packet_duration = nb_samples; return nb_samples; } @@ -966,6 +968,12 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) st->decode_gain = value; } break; + case OPUS_GET_LAST_PACKET_DURATION_REQUEST: + { + opus_uint32 *value = va_arg(ap, opus_uint32*); + *value = st->last_packet_duration; + } + break; default: /*fprintf(stderr, "unknown opus_decoder_ctl() request: %d", request);*/ ret = OPUS_UNIMPLEMENTED; |