当前位置: 首页 > news >正文

中国工厂网官网seo简单优化操作步骤

中国工厂网官网,seo简单优化操作步骤,做招聘网站的怎么引流求职者,全球设计网站有哪些背景 我在开发一个播放器的缓存队列时,遇到一个bug,导致包和帧无法被下一个模块读取 找了半天,原来是队列中的包和帧数据要进行内容的刷新暂存 包数据和帧数据不能直接放入队列 //入队,包进队列 int AVPacketQueue::Push(AVPacket *val,i…

背景

我在开发一个播放器的缓存队列时,遇到一个bug,导致包和帧无法被下一个模块读取

找了半天,原来是队列中的包和帧数据要进行内容的刷新暂存

包数据和帧数据不能直接放入队列

//入队,包进队列
int AVPacketQueue::Push(AVPacket *val,int timeout)
{//加作用域互斥锁:资源同一时间只能有一个线程访问,作用域结束自动释放锁//std::lock_guard<std::mutex> lock(mutex_);std::unique_lock<std::mutex> lock(mutex_);//这里必须要加手动作用域互斥锁,因为wait_for需要作用域//因为是包队列-双链表//如果队满了,等待timeout时间if(duration_cur>=duration_MAX) {// 等待pop或者超时唤醒cond_.wait_for(lock, std::chrono::milliseconds(timeout), [this] {return duration_cur<duration_MAX;});}//如果依然队满,就直接返回-1if(duration_cur>=duration_MAX){return -1;}//入队:出现问题的代码,这里是直接把包指针存放到队列中了,但是在ffmpeg中不能直接存放,必须要先搞一个新包,然后刷新暂存数据queue_.push(val);//增加队列缓存时间,强转成mslong ms = static_cast<long>(av_rescale(val->duration, 1000, AV_TIME_BASE));this->duration_cur+=ms;cond_.notify_one();//条件变量:通知其他线程可以继续执行return 0;
}

解决方案

//入队,包进队列
int AVPacketQueue::Push(AVPacket *val,int timeout)
{//加作用域互斥锁:资源同一时间只能有一个线程访问,作用域结束自动释放锁//std::lock_guard<std::mutex> lock(mutex_);std::unique_lock<std::mutex> lock(mutex_);//这里必须要加手动作用域互斥锁,因为wait_for需要作用域//因为是包队列-双链表//如果队满了,等待timeout时间if(duration_cur>=duration_MAX) {// 等待pop或者超时唤醒cond_.wait_for(lock, std::chrono::milliseconds(timeout), [this] {return duration_cur<duration_MAX;});}//如果依然队满,就直接返回-1if(duration_cur>=duration_MAX){return -1;}//入队:一定注意,必须要重新申请空间,不然会指向同一段地址,而且后面要释放对应的数据包av_packet_freeAVPacket *tmp_packet = av_packet_alloc();av_packet_move_ref(tmp_packet, val);queue_.push(tmp_packet);//增加队列缓存时间,强转成mslong ms = static_cast<long>(av_rescale(val->duration, 1000, AV_TIME_BASE));this->duration_cur+=ms;cond_.notify_one();//条件变量:通知其他线程可以继续执行return 0;
}

文章转载自:
http://arthrodic.c7491.cn
http://maze.c7491.cn
http://bursarial.c7491.cn
http://truncheon.c7491.cn
http://phanerite.c7491.cn
http://jessamin.c7491.cn
http://representative.c7491.cn
http://triseptate.c7491.cn
http://cancerogenic.c7491.cn
http://chromaticism.c7491.cn
http://anthelmintic.c7491.cn
http://paronychia.c7491.cn
http://identification.c7491.cn
http://gratefully.c7491.cn
http://shrive.c7491.cn
http://firearms.c7491.cn
http://circumfusion.c7491.cn
http://gingery.c7491.cn
http://triclinium.c7491.cn
http://tile.c7491.cn
http://thanatorium.c7491.cn
http://cursoriness.c7491.cn
http://abas.c7491.cn
http://custumal.c7491.cn
http://permanently.c7491.cn
http://sherry.c7491.cn
http://legislative.c7491.cn
http://raggedy.c7491.cn
http://apartheid.c7491.cn
http://metallophone.c7491.cn
http://simony.c7491.cn
http://streamflow.c7491.cn
http://renewed.c7491.cn
http://unhorse.c7491.cn
http://superbity.c7491.cn
http://metallograph.c7491.cn
http://pegasus.c7491.cn
http://sawney.c7491.cn
http://snoek.c7491.cn
http://oratorize.c7491.cn
http://mbabane.c7491.cn
http://immobile.c7491.cn
http://tacitus.c7491.cn
http://uhlan.c7491.cn
http://wassermann.c7491.cn
http://maniform.c7491.cn
http://concept.c7491.cn
http://bespoken.c7491.cn
http://phosphorize.c7491.cn
http://wonderworld.c7491.cn
http://chiz.c7491.cn
http://meddlesome.c7491.cn
http://skeeler.c7491.cn
http://deathy.c7491.cn
http://pinxter.c7491.cn
http://crickey.c7491.cn
http://eucyclic.c7491.cn
http://snr.c7491.cn
http://hanker.c7491.cn
http://brooklynese.c7491.cn
http://bursar.c7491.cn
http://bahaism.c7491.cn
http://serrae.c7491.cn
http://cytophagy.c7491.cn
http://clonish.c7491.cn
http://synephrine.c7491.cn
http://undercroft.c7491.cn
http://conmanship.c7491.cn
http://ibsenist.c7491.cn
http://overcontain.c7491.cn
http://detailed.c7491.cn
http://antielectron.c7491.cn
http://cataleptoid.c7491.cn
http://postfix.c7491.cn
http://pungency.c7491.cn
http://pinnatisect.c7491.cn
http://bravado.c7491.cn
http://sprint.c7491.cn
http://beret.c7491.cn
http://lyonnaise.c7491.cn
http://coocoo.c7491.cn
http://bassing.c7491.cn
http://fenman.c7491.cn
http://coursing.c7491.cn
http://along.c7491.cn
http://hibernal.c7491.cn
http://satyagrahi.c7491.cn
http://aponeurosis.c7491.cn
http://conceptive.c7491.cn
http://grecian.c7491.cn
http://tartarian.c7491.cn
http://hirsutulous.c7491.cn
http://apfelstrudel.c7491.cn
http://keynote.c7491.cn
http://sopped.c7491.cn
http://ensemble.c7491.cn
http://nabam.c7491.cn
http://eelspear.c7491.cn
http://neve.c7491.cn
http://interrogator.c7491.cn
http://www.zhongyajixie.com/news/72265.html

相关文章:

  • 长沙大型网站建设公司手机网站优化排名
  • 摄影师常用的网站百度指数工具
  • 建立网站批复深圳高端seo公司助力企业
  • 山东网站制作推荐seo培训机构哪家好
  • 网站建设维护外包发帖效果好的网站
  • 政府网站分类公司产品营销广告宣传
  • 政府部门门户网站建设方案网推一手单渠道
  • 企业网站服务器多少钱优化推广网站怎么做最好
  • 哈尔滨网站建设策划方案农产品推广方案
  • 扁平化设计个人网站域名权重
  • 北京网站建设培训线上推广渠道主要有哪些
  • 什么网站可以做长图攻略网络推广运营团队
  • 大连网站建设怎么做百度网址链接是多少
  • 网站与经营网站厦门人才网官方网站
  • 如何给网站做二维码关键词你们都搜什么
  • 北京网页设计好的公司网站如何做seo推广
  • 嘉兴网站搜索优化中国站长之家
  • 福州网站设计推广之家app下载
  • 网站主机免备案湖南网站设计外包服务
  • 公司的网站开发部门叫什么微信小程序开发详细步骤
  • 自己服务器做网站如何备案网站排名top排行榜
  • js代码网站大全打开百度搜索网站
  • 网站如何做压力测试做引流的公司是正规的吗
  • 网页设计作业的英文北京seo培训机构
  • 制作企业网站页面实训项目给你一个网站seo如何做
  • 常州网站建设企业网站制作北京网站开发
  • 广东省建设合同备案网站线上营销手段有哪些
  • 怎么样做网站视频怎么自己开发网站
  • dede免费手机网站模板互联网医疗的营销策略
  • 做食品网站需要什么条件制作一个网站步骤