]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/crystalhd: Explicitly set frame pts at all times
authorPhilip Langdale <philipl@overt.org>
Sun, 23 Apr 2017 21:34:03 +0000 (14:34 -0700)
committerPhilip Langdale <philipl@overt.org>
Sun, 23 Apr 2017 22:33:36 +0000 (15:33 -0700)
Previously, the pts value was initialised to AV_NOPTS_VALUE and so
it was not necessary to always set it. Now, with the new-new decode
API, this is no longer true. I'm not sure why I avoided setting the
pts when the decoder value was also AV_NOPTS_VALUE - it clearly
wouldn't have changed anything previously, but here we are.

Failing to do this, means the frame pts will be some random uninitalised
value.

libavcodec/crystalhd.c

index 8956ca4bfb6c485fe86fe681b85a294c429c0f5e..a22dfe16eae6bb85aa52eac52d777dfd4c3ad138 100644 (file)
@@ -537,14 +537,13 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
     if (interlaced)
         frame->top_field_first = !bottom_first;
 
-    if (pkt_pts != AV_NOPTS_VALUE) {
-        frame->pts = pkt_pts;
+    frame->pts = pkt_pts;
 #if FF_API_PKT_PTS
 FF_DISABLE_DEPRECATION_WARNINGS
-        frame->pkt_pts = pkt_pts;
+    frame->pkt_pts = pkt_pts;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
-    }
+
     frame->pkt_pos = -1;
     frame->pkt_duration = 0;
     frame->pkt_size = -1;