[FFmpeg-cvslog] avcodec/exr: read fps from metadata too

Paul B Mahol git at videolan.org
Mon Feb 15 18:40:53 EET 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Feb 15 17:26:13 2021 +0100| [98191135e03afe1de566c9d6a0eb3e3f9010cade] | committer: Paul B Mahol

avcodec/exr: read fps from metadata too

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98191135e03afe1de566c9d6a0eb3e3f9010cade
---

 libavcodec/exr.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 6e6ce4275c..ef14bfd69a 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1634,6 +1634,17 @@ static int decode_header(EXRContext *s, AVFrame *frame)
             bytestream2_get_buffer(&s->gb, key, FFMIN(sizeof(key) - 1, var_size));
             av_dict_set(&metadata, "writer", key, 0);
 
+            continue;
+        } else if ((var_size = check_header_variable(s, "framesPerSecond",
+                                                     "rational", 33)) >= 0) {
+            if (!var_size) {
+                ret = AVERROR_INVALIDDATA;
+                goto fail;
+            }
+
+            s->avctx->framerate.num = bytestream2_get_le32(&s->gb);
+            s->avctx->framerate.den = bytestream2_get_le32(&s->gb);
+
             continue;
         }
 



More information about the ffmpeg-cvslog mailing list