[vlc-commits] demux: hls: read framerate

Francois Cartegnie git at videolan.org
Thu Mar 4 13:47:34 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Feb 23 22:40:08 2021 +0100| [0d61e9a1b8d27df6af5bf1c4ff1f6d51ede4594b] | committer: Francois Cartegnie

demux: hls: read framerate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d61e9a1b8d27df6af5bf1c4ff1f6d51ede4594b
---

 modules/demux/hls/playlist/Parser.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index a43ec7f8ab..07e329ced6 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -135,6 +135,14 @@ HLSRepresentation * M3U8Parser::createRepresentation(BaseAdaptationSet *adaptSet
                 rep->setHeight(res.second);
             }
         }
+
+        const Attribute *rateAttr = tag->getAttributeByName("FRAME-RATE");
+        if(rateAttr)
+        {
+            unsigned num, den;
+            vlc_ureduce(&num, &den, rateAttr->floatingPoint() * 1000, 1000, 0);
+            rep->setFrameRate(Rate(num, den));
+        }
     }
 
     return rep;



More information about the vlc-commits mailing list