File: armhf-timespec.patch

package info (click to toggle)
chromium 143.0.7499.40-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,343,624 kB
  • sloc: cpp: 35,786,473; ansic: 7,477,456; javascript: 4,249,966; python: 1,480,744; xml: 764,791; asm: 710,816; pascal: 188,028; sh: 89,200; perl: 88,692; objc: 79,984; sql: 57,625; cs: 42,265; fortran: 24,101; makefile: 22,508; tcl: 15,277; php: 14,018; yacc: 9,043; ruby: 7,553; awk: 3,720; lisp: 3,233; lex: 1,330; ada: 727; jsp: 228; sed: 36
file content (37 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
author: Andres Salomon <dilinger@debian.org>

fix armhf build failure:

../../media/gpu/v4l2/legacy/v4l2_video_decoder_backend_stateful.cc:446:20: error: non-constant-expression cannot be narrowed from type '__suseconds64_t' (aka 'long long') to 'long' in initializer list [-Wc++11-narrowing]
  446 |         .tv_nsec = timeval.tv_usec * 1000,
      |                    ^~~~~~~~~~~~~~~~~~~~~~
../../media/gpu/v4l2/legacy/v4l2_video_decoder_backend_stateful.cc:446:20: note: insert an explicit cast to silence this issue
  446 |         .tv_nsec = timeval.tv_usec * 1000,
      |                    ^~~~~~~~~~~~~~~~~~~~~~
      |                    static_cast<long>(    )
1 error generated.


--- a/media/gpu/v4l2/legacy/v4l2_video_decoder_backend_stateful.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decoder_backend_stateful.cc
@@ -28,6 +28,8 @@
 #include "media/gpu/v4l2/v4l2_video_decoder_backend.h"
 #include "media/gpu/v4l2/v4l2_vp9_helpers.h"
 
+#include "build/build_config.h"
+
 namespace media {
 
 namespace {
@@ -443,7 +445,11 @@ void V4L2StatefulVideoDecoderBackend::On
     const struct timeval timeval = buffer->GetTimeStamp();
     const struct timespec timespec = {
         .tv_sec = timeval.tv_sec,
+#if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS)
+        .tv_nsec = static_cast<long>(timeval.tv_usec) * 1000,
+#else
         .tv_nsec = timeval.tv_usec * 1000,
+#endif
     };
 
     const int64_t flat_timespec =