Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swr_init(swrContext) fail and return -22 #164

Open
vhikd opened this issue Dec 25, 2016 · 0 comments
Open

swr_init(swrContext) fail and return -22 #164

vhikd opened this issue Dec 25, 2016 · 0 comments

Comments

@vhikd
Copy link

vhikd commented Dec 25, 2016

Hello,

When I play some audio with FFMpeg 3.0 or later , the KxMovieDecoder.m on the line 905, failed .

`id audioManager = [KxAudioManager audioManager];
swrContext = swr_alloc_set_opts(NULL,
av_get_default_channel_layout(audioManager.numOutputChannels),
AV_SAMPLE_FMT_S16,
audioManager.samplingRate,
av_get_default_channel_layout(codecCtx->channels),
codecCtx->sample_fmt,
codecCtx->sample_rate,
0,
NULL);

    int sw = swr_init(swrContext);
    if (!swrContext ||
        sw ) {
        
        if (swrContext)
            swr_free(&swrContext);
         avcodec_close(codecCtx);

        return kxMovieErroReSampler;
    }`

The sw=-22,any suggestions to solve this problem?

Wish your message . Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant