diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-25 23:13:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-25 23:40:59 +0200 |
commit | e0e60c9211332e3b41512e0a65ba02d613b6fd3f (patch) | |
tree | 0ca772e84fe87106a01e7a38354344ace3fb98a4 /libavcodec/dpx.c | |
parent | af165acefacd89196c003c24802fa3c494d54d3a (diff) | |
download | ffmpeg-e0e60c9211332e3b41512e0a65ba02d613b6fd3f.tar.gz |
avcodec/dpx: extract frame rate
Fixes part of Ticket3511
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r-- | libavcodec/dpx.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 5c3c3e81cb..bbb06d2724 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -20,6 +20,7 @@ */ #include "libavutil/intreadwrite.h" +#include "libavutil/intfloat_readwrite.h" #include "libavutil/imgutils.h" #include "bytestream.h" #include "avcodec.h" @@ -146,6 +147,16 @@ static int decode_frame(AVCodecContext *avctx, else avctx->sample_aspect_ratio = (AVRational){ 0, 1 }; + if (offset >= 1724 + 4) { + buf = avpkt->data + 1724; + i = read32(&buf, endian); + if(i) { + AVRational q = av_d2q(av_int2flt(i), 4096); + if (q.num > 0 && q.den > 0) + avctx->time_base = av_inv_q(q); + } + } + switch (descriptor) { case 6: // Y elements = 1; |