Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PyAV
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyAV
  • PyAV
  • Merge requests
  • !388

Const warnings

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jeremy Lainé requested to merge github/fork/jlaine/const-warnings into develop 6 years ago
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 2

This PR fixes a few more compiler warnings about constness

Compare
  • develop (base)

and
  • latest version
    91e25a67
    2 commits, 2 years ago

2 files
+ 10
- 7

    Preferences

    File browser
    Compare changes
a‎v‎
au‎dio‎
resamp‎ler.pyx‎ +2 -2
vi‎deo‎
fram‎e.pyx‎ +8 -5
av/audio/resampler.pyx
+ 2
- 2
  • View file @ 91e25a67

  • Edit in single-file editor

  • Open in Web IDE


from libc.stdint cimport uint64_t
from libc.stdint cimport uint64_t, uint8_t
cimport libav as lib
@@ -165,7 +165,7 @@ cdef class AudioResampler(object):
self.ptr,
output.ptr.extended_data,
output_nb_samples,
frame.ptr.extended_data if frame else NULL,
<const uint8_t**>(frame.ptr.extended_data if frame else NULL),
frame.ptr.nb_samples if frame else 0
))
av/video/frame.pyx
+ 8
- 5
  • View file @ 91e25a67

  • Edit in single-file editor

  • Open in Web IDE


from libc.stdint cimport uint8_t
from av.bytesource cimport ByteSource, bytesource
from av.utils cimport err_check
from av.video.format cimport get_video_format, VideoFormat
@@ -173,13 +175,14 @@ cdef class VideoFrame(Frame):
NULL
)
cdef int *inv_tbl
cdef int *tbl
cdef int *rgbTbl
cdef const int *inv_tbl
cdef const int *tbl
cdef int srcRange, dstRange, brightness, contrast, saturation
cdef int ret
with nogil:
ret = lib.sws_getColorspaceDetails(self.reformatter.ptr, &inv_tbl, &srcRange, &tbl, &dstRange, &brightness, &contrast, &saturation)
ret = lib.sws_getColorspaceDetails(
self.reformatter.ptr, <int**>&inv_tbl, &srcRange, <int**>&tbl, &dstRange,
&brightness, &contrast, &saturation)
if not ret < 0:
if src_colorspace != lib.SWS_CS_DEFAULT:
inv_tbl = lib.sws_getCoefficients(src_colorspace)
@@ -196,7 +199,7 @@ cdef class VideoFrame(Frame):
with nogil:
lib.sws_scale(
self.reformatter.ptr,
self.ptr.data,
<const uint8_t**>self.ptr.data,
self.ptr.linesize,
0, # slice Y
self.ptr.height,
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
2
2 participants
Administrator
Jeremy Lainé
Reference: PyAV-Org/PyAV!388
Source branch: github/fork/jlaine/const-warnings

Menu

Explore Projects Groups Snippets