summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-02-26 19:33:56 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-02-26 19:33:56 +0100
commit3d59a60117b6b8f6326143d51388c6518c1ddc34 (patch)
tree3353533f9071434b2098828559cae3bf27d0ebc5 /modules
parentb43fc6f8b387b64ee06cdc3669ae63300e2eb947 (diff)
avcodec: print decoder framerate
Diffstat (limited to 'modules')
-rw-r--r--modules/avcodec/decode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/avcodec/decode.c b/modules/avcodec/decode.c
index 61743e1..63c704f 100644
--- a/modules/avcodec/decode.c
+++ b/modules/avcodec/decode.c
@@ -37,6 +37,7 @@ struct viddec_state {
size_t frag_start;
bool frag;
uint16_t frag_seq;
+ double fps;
struct {
unsigned n_key;
@@ -237,6 +238,8 @@ static int ffdecode(struct viddec_state *st, struct vidframe *frame)
if (got_picture) {
+ double fps;
+
#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
switch (st->pict->format) {
@@ -270,6 +273,14 @@ static int ffdecode(struct viddec_state *st, struct vidframe *frame)
}
frame->size.w = st->ctx->width;
frame->size.h = st->ctx->height;
+
+ /* get the framerate of the decoded bitstream */
+ fps = av_q2d(st->ctx->framerate);
+ if (st->fps != fps) {
+ st->fps = fps;
+ debug("avcodec: current decoder framerate"
+ " is %.2f fps\n", fps);
+ }
}
out: