c59d34
# HG changeset patch
c59d34
# Parent  381102061fccdec40efda75c7423a766f68201ba
c59d34
Bug-behavior: Youtube-videos using VP9 and opus as audio-codec started loading but did not play
c59d34
Reason: While parsing the audio-stream, the sampling frequency (short rate) was wrongly parsed by
c59d34
        nestegg, returning 0 all the time. This led to the audio-track reporting that it neither had 
c59d34
        valid video nor audio. Which led to an endless-loop in the video state machine.
c59d34
Solution: Correct parsing of rate in nestegg, which is a float and cuts of bytes.
c59d34
Link: https://github.com/kinetiknz/nestegg/issues/64
c59d34
c59d34
diff -r 381102061fcc -r 8da4be020b1e media/libnestegg/src/nestegg.c
c59d34
--- a/media/libnestegg/src/nestegg.c	Tue Aug 13 07:51:27 2019 +0200
c59d34
+++ b/media/libnestegg/src/nestegg.c	Tue Aug 20 07:59:54 2019 +0200
c59d34
@@ -768,7 +768,15 @@
c59d34
 {
c59d34
   union {
c59d34
     uint64_t u;
c59d34
-    float f;
c59d34
+    struct {
c59d34
+#if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
c59d34
+      uint32_t _pad;
c59d34
+      float f;
c59d34
+#else
c59d34
+      float f;
c59d34
+      uint32_t _pad;
c59d34
+#endif
c59d34
+    } f;
c59d34
     double d;
c59d34
   } value;
c59d34
   int r;
c59d34
@@ -780,7 +788,7 @@
c59d34
   if (r != 1)
c59d34
     return r;
c59d34
   if (length == 4)
c59d34
-    *val = value.f;
c59d34
+    *val = value.f.f;
c59d34
   else
c59d34
     *val = value.d;
c59d34
   return 1;