AkarinVS / L-SMASH-Works

Works based on L-SMASH project; This repo focuses on the common portion and the VapourSynth plugin. AviSynth users please use https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works. ffmpeg 5.0+ please use ffmpeg-4.5 branch.
47 stars 11 forks source link

const variable reassignment #25

Closed Asd-g closed 2 years ago

Asd-g commented 2 years ago

In decode.c there are two reassignments of const var:

AkarinVS commented 2 years ago

const AVCodec *codec means a pointer to const AVCodec object, so we can't modify the object the pointer points to, but we can modify the pointer itself. contrast that withAVCodec *const codec = NULL;`, which means the pointer variable itself is constant but we can modify the object the pointer points to.

Or am I missing something?

Message ID: @.***>

Asd-g commented 2 years ago

You're right. I got confused them.