mirror of
https://github.com/asticode/go-astiav.git
synced 2025-11-01 20:12:51 +08:00
Removed pointer on ChannelLayout + now cloning channel layouts in getters
This commit is contained in:
@@ -53,11 +53,12 @@ func (cc *CodecContext) SetChannels(channels int) {
|
||||
cc.c.channels = C.int(channels)
|
||||
}
|
||||
|
||||
func (cc *CodecContext) ChannelLayout() *ChannelLayout {
|
||||
return newChannelLayoutFromC(&cc.c.ch_layout)
|
||||
func (cc *CodecContext) ChannelLayout() ChannelLayout {
|
||||
l, _ := newChannelLayoutFromC(&cc.c.ch_layout).clone()
|
||||
return l
|
||||
}
|
||||
|
||||
func (cc *CodecContext) SetChannelLayout(l *ChannelLayout) {
|
||||
func (cc *CodecContext) SetChannelLayout(l ChannelLayout) {
|
||||
l.copy(&cc.c.ch_layout) //nolint: errcheck
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user