summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-01-26 20:08:23 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-03-05 13:08:15 -0500
commit9524cf79df9f4f5792272e7e53f7dcc90ee26e61 (patch)
tree76861289a8b6392cbfe429d836b877ae697b1499 /libavcodec/avcodec.h
parent6699d07480f58bc20068b2d90fcd6ca8e3aa46b8 (diff)
avcodec: add av_get_audio_frame_duration() function.
This is a utility function for the user to get the frame duration based on the codec id, frame size in bytes, and various AVCodecContext parameters.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bdd72f7d5c..7074b582ec 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3942,6 +3942,16 @@ int av_get_bits_per_sample(enum CodecID codec_id);
*/
int av_get_exact_bits_per_sample(enum CodecID codec_id);
+/**
+ * Return audio frame duration.
+ *
+ * @param avctx codec context
+ * @param frame_bytes size of the frame, or 0 if unknown
+ * @return frame duration, in samples, if known. 0 if not able to
+ * determine.
+ */
+int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
+
/* frame parsing */
typedef struct AVCodecParserContext {
void *priv_data;