auto c = demux_.Open(url.c_str()); if (!c) returnfalse; demux_.set_c(c); demux_.set_time_out_ms(timeout_ms); LOGDEBUG("XDemuxTask::End!"); returntrue; }
voidXDemuxTask::Main() { AVPacket pkt; while (!is_exit_) { if (!demux_.Read(&pkt)) { cout << "-" << flush; if (!demux_.is_connected()) { Open(url_, timeout_ms_); } this_thread::sleep_for(1ms); continue; }
cout << "." << flush; if (syn_type_ == XSYN_VIDEO && pkt.stream_index == demux_.video_index()) { auto dur = demux_.RescaleToMs(pkt.duration, pkt.stream_index); if (dur <= 0) dur = 40; MSleep(40); } Next(&pkt); av_packet_unref(&pkt);
auto c = demux_.Open(url.c_str()); if (!c) returnfalse; demux_.set_c(c); demux_.set_time_out_ms(timeout_ms); LOGDEBUG("XDemuxTask::End!"); returntrue; }