mozilla-nestegg-big-endian.patch
branchfirefox70
changeset 1112 8a4f5aea2475
parent 1111 97a6da6d7e29
child 1113 8e9195853a32
equal deleted inserted replaced
1111:97a6da6d7e29 1112:8a4f5aea2475
     1 # HG changeset patch
       
     2 # Parent  381102061fccdec40efda75c7423a766f68201ba
       
     3 Bug-behavior: Youtube-videos using VP9 and opus as audio-codec started loading but did not play
       
     4 Reason: While parsing the audio-stream, the sampling frequency (short rate) was wrongly parsed by
       
     5         nestegg, returning 0 all the time. This led to the audio-track reporting that it neither had 
       
     6         valid video nor audio. Which led to an endless-loop in the video state machine.
       
     7 Solution: Correct parsing of rate in nestegg, which is a float and cuts of bytes.
       
     8 Link: https://github.com/kinetiknz/nestegg/issues/64
       
     9 
       
    10 diff -r 381102061fcc -r 8da4be020b1e media/libnestegg/src/nestegg.c
       
    11 --- a/media/libnestegg/src/nestegg.c	Tue Aug 13 07:51:27 2019 +0200
       
    12 +++ b/media/libnestegg/src/nestegg.c	Tue Aug 20 07:59:54 2019 +0200
       
    13 @@ -768,7 +768,15 @@
       
    14  {
       
    15    union {
       
    16      uint64_t u;
       
    17 -    float f;
       
    18 +    struct {
       
    19 +#if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
       
    20 +      uint32_t _pad;
       
    21 +      float f;
       
    22 +#else
       
    23 +      float f;
       
    24 +      uint32_t _pad;
       
    25 +#endif
       
    26 +    } f;
       
    27      double d;
       
    28    } value;
       
    29    int r;
       
    30 @@ -780,7 +788,7 @@
       
    31    if (r != 1)
       
    32      return r;
       
    33    if (length == 4)
       
    34 -    *val = value.f;
       
    35 +    *val = value.f.f;
       
    36    else
       
    37      *val = value.d;
       
    38    return 1;