Skip to content

Commit

Permalink
Enable rtmp timeout in decoder (#3076)
Browse files Browse the repository at this point in the history
Summary:
* Link libav change into fbcode
* Set rw_timeout value

Differential Revision: D23412524

fbshipit-source-id: 5755950be1b1b4c37cb0c3a69a8c875f8862a92c

Co-authored-by: Keyun Tong <ktong@fb.com>
  • Loading branch information
fmassa and Keyun Tong authored Dec 1, 2020
1 parent 1b83f46 commit 4eb9f66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions torchvision/csrc/cpu/decoder/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,14 @@ bool Decoder::init(
inputCtx_->flags |= AVFMT_FLAG_NONBLOCK;

AVDictionary* options = nullptr;
av_dict_set_int(&options, "analyzeduration", params_.timeoutMs * 1000, 0);
av_dict_set_int(&options, "stimeout", params_.timeoutMs * 1000, 0);
if (params_.listen) {
av_dict_set_int(&options, "listen", 1, 0);
}
if (params_.timeoutMs > 0) {
av_dict_set_int(&options, "analyzeduration", params_.timeoutMs * 1000, 0);
av_dict_set_int(&options, "stimeout", params_.timeoutMs * 1000, 0);
av_dict_set_int(&options, "rw_timeout", params_.timeoutMs * 1000, 0);
}

interrupted_ = false;

Expand Down

0 comments on commit 4eb9f66

Please sign in to comment.