码迷,mamicode.com
首页 > 其他好文 > 详细

mpc-hc

时间:2015-12-23 22:56:08      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:

2015-12-23

21:28:05 modify the duration

Q:mpc-hc cannot get the duration of video

S: To fix the condition part  follow this

 if(m_avFormat->duration == (int64_t)AV_NOPTS_VALUE || m_avFormat->duration < 0LL)

 

REFERENCE_TIME CLAVFDemuxer::GetDuration() const
{
  int64_t iLength = 0;
  if (m_avFormat->duration == (int64_t)AV_NOPTS_VALUE || m_avFormat->duration < 0LL) {
    // no duration is available for us
    // try to calculate it
    // TODO
    /*if (m_rtCurrent != Packet::INVALID_TIME && m_avFormat->file_size > 0 && m_avFormat->pb && m_avFormat->pb->pos > 0) {
    iLength = (((m_rtCurrent * m_avFormat->file_size) / m_avFormat->pb->pos) / 1000) & 0xFFFFFFFF;
    }*/
    DbgLog((LOG_ERROR, 1, TEXT("duration is not available")));
    return -1;
  } else {
    iLength = m_avFormat->duration;
  }
  return ConvertTimestampToRT(iLength, 1, AV_TIME_BASE, 0);
}

  

mpc-hc

标签:

原文地址:http://www.cnblogs.com/anyboo/p/5071477.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!