Commit 33588540 authored by Tristan Matthews's avatar Tristan Matthews

* #28578: video: fix hang in avformat_open_input

parent 106f155d
......@@ -211,7 +211,7 @@ void SocketPair::openSockets(const char *uri, int local_rtp_port)
VideoIOHandle* SocketPair::getIOContext()
{
if (!ioHandle_)
ioHandle_ = new VideoIOHandle(RTP_BUFFER_SIZE,
ioHandle_ = new VideoIOHandle(RTP_BUFFER_SIZE, true,
&readCallback, &writeCallback, 0,
reinterpret_cast<void*>(this));
return ioHandle_;
......
......@@ -70,6 +70,7 @@ namespace sfl_video {
class VideoIOHandle {
public:
VideoIOHandle(ssize_t buffer_size,
bool writeable,
io_readcallback read_cb,
io_writecallback write_cb,
io_seekcallback seek_cb,
......@@ -77,7 +78,7 @@ namespace sfl_video {
{
buf_ = static_cast<unsigned char *>(av_malloc(buffer_size));
ctx_ = avio_alloc_context(buf_, buffer_size, 1, opaque, read_cb,
ctx_ = avio_alloc_context(buf_, buffer_size, writeable, opaque, read_cb,
write_cb, seek_cb);
ctx_->max_packet_size = buffer_size;
}
......
......@@ -152,7 +152,7 @@ namespace sfl_video {
id_(id),
requestKeyFrameCallback_(0),
stream_(args_["receiving_sdp"]),
sdpContext_(SDP_BUFFER_SIZE, &readFunction, 0, 0, this),
sdpContext_(SDP_BUFFER_SIZE, false, &readFunction, 0, 0, this),
demuxContext_(0),
thread_(0)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment