<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Perfect. Best regards.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">In data mercoledì 30 agosto 2023 16:14:03 CEST, John Regan via Libav-user ha scritto:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> On Wed, 30 Aug 2023 15:39:08 +0200</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Denis Gottardello <info@denisgottardello.it> wrote:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > Hi. When I try to compile the following line of code</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > av_channel_layout_copy(&c->ch_layout,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO);</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > taken from mux.c example I obtain the error:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > /home/denis/Cpp/ffmpeg-6.0/libavutil/channel_layout.h:362: *error:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > taking address of rvalue [-fpermissive]*</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > ../../ffmpeg-6.0/libavutil/channel_layout.h:362:5: error: taking</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > address of rvalue [-fpermissive] 362 |     { .order =</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} |</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> >     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> >     ~~~~~~~~> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > ../../ffmpeg-6.0/libavutil/channel_layout.h:369:45: note: in</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > expansion of macro ‘AV_CHANNEL_LAYOUT_MASK’ 369 | #define</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > AV_CHANNEL_LAYOUT_STEREO            AV_CHANNEL_LAYOUT_MASK(2,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > AV_CH_LAYOUT_STEREO) |</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > ^~~~~~~~~~~~~~~~~~~~~~ ../ffmpegTest/main.cpp:157:65: note: in</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > expansion of macro ‘AV_CHANNEL_LAYOUT_STEREO’ 157 |</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > av_channel_layout_copy(&c->ch_layout,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); |</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> >                                          ^~~~~~~~~~~~~~~~~~~~~~~~</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > How can I translate it to work in Windows, Linux and Mac?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > Something like this?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> >         AVChannelLayout a= AV_CHANNEL_LAYOUT_STEREO;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> >         av_channel_layout_copy(&c->ch_layout, &a);</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> If you're assigning one of the standard layouts you should be able to</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> just do</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>     c->ch_layout = AV_CHANNEL_LAYOUT_STEREO;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> At least, assuming that the AVCodecContext has just been allocated</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> (like it is in mux.c). If you had an existing channel layout set, you'd</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> want to do a copy since that will free any custom channel layout data</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> for you.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> From your output it looks like you're compiling as C++, and some of the</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> code in mux.c is valid C code, but not valid C++ code (such as taking</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> the address of an rvalue).</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> _______________________________________________</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Libav-user mailing list</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Libav-user@ffmpeg.org</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> https://ffmpeg.org/mailman/listinfo/libav-user</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> To unsubscribe, visit link above, or email</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> libav-user-request@ffmpeg.org with subject "unsubscribe".<br />-- </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><span style="background-color:#ffffff;"><span style="font-size:-0.083em;"><span style="color:#232629;">+39.347.4070897</span></span></span></p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><a href="http://www.labcsp.com">http://www.labcsp.com</a><span style="color:#232629;"> </span></p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><a href="http://www.denisgottardello.it">http://www.denisgottardello.it</a><span style="color:#232629;"> </span></p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><span style="background-color:#ffffff;"><span style="color:#232629;">GMT+1</span></span></p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><span style="background-color:#ffffff;"><span style="color:#232629;">Skype: mrdebug</span></span></p>
</body>
</html>