mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Use the decoded frame pts when available
This commit is contained in:
parent
1ea1407707
commit
cab68df257
1 changed files with 5 additions and 4 deletions
|
@ -631,11 +631,12 @@ public:
|
|||
if (avcodec_decode_video2(is->video_st->codec, pFrame, &frameFinished, packet) < 0)
|
||||
throw std::runtime_error("Error decoding video frame");
|
||||
|
||||
if((uint64_t)packet->dts == AV_NOPTS_VALUE &&
|
||||
pFrame->opaque && *(uint64_t*)pFrame->opaque != AV_NOPTS_VALUE)
|
||||
if((uint64_t)pFrame->pts != AV_NOPTS_VALUE)
|
||||
pts = pFrame->pts;
|
||||
else if((uint64_t)packet->pts != AV_NOPTS_VALUE)
|
||||
pts = packet->pts;
|
||||
else if(pFrame->opaque && *(uint64_t*)pFrame->opaque != AV_NOPTS_VALUE)
|
||||
pts = *(uint64_t *)pFrame->opaque;
|
||||
else if((uint64_t)packet->dts != AV_NOPTS_VALUE)
|
||||
pts = packet->dts;
|
||||
else
|
||||
pts = 0;
|
||||
pts *= av_q2d(is->video_st->time_base);
|
||||
|
|
Loading…
Reference in a new issue