Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to cast



  • Hi, can you suggest me how to cast in "new style" the following line of code ((const uint8_t**)pAVFrame->data)?

    Ret= swr_convert(pSwrContext, static_cast<uint8_t**>(&buffer), pAVFrame->nb_samples, (const uint8_t**)pAVFrame->data, pAVFrame->nb_samples);
    

    int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count);
    pAVFrame->data is uint8_t *data[AV_NUM_DATA_POINTERS];



  • Ret= swr_convert(pSwrContext, static_cast<uint8_t**>(&buffer), pAVFrame->nb_samples, const_cast<const uint8_t**>(pAVFrame->data), pAVFrame->nb_samples);
    


  • I too very much dislike c++ style casts... too fracking wordy to use them in places like

    uint8_t c{ 0x43 };
    cout << static_cast<int>(c);
    // would be shorter and just as obvious when done as
    cout << (int)c;
    

Log in to reply