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

#1795 Give the decoder more time to analyze #7

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/media/media_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,19 @@ MediaDecoder::setupStream()
JAMI_DBG() << "Using framerate emulation";
startTime_ = av_gettime(); // used to set pts after decoding, and for rate emulation

AVDictionary* options = nullptr;
av_dict_set(&options, "analyzeduration", std::to_string(90 * 1000000).c_str(), 0); // wait 30s, instead of default 5
av_dict_set(&options, "probesize", std::to_string(5000 * 1000000).c_str(), 0); // instead of default 5

#ifdef RING_ACCEL
if (!accel_) {
JAMI_WARN("Not using hardware decoding for %s", avcodec_get_name(decoderCtx_->codec_id));
ret = avcodec_open2(decoderCtx_, inputDecoder_, nullptr);
ret = avcodec_open2(decoderCtx_, inputDecoder_, &options);
}
#else
ret = avcodec_open2(decoderCtx_, inputDecoder_, nullptr);
ret = avcodec_open2(decoderCtx_, inputDecoder_, &options);
#endif
av_dict_free(&options);
if (ret < 0) {
JAMI_ERR() << "Unable to open codec: " << libav_utils::getError(ret);
return -1;
Expand Down