[SCM] libav/experimental: Adopt pkt_dts/pkt_pts in lavc clients

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:23:13 UTC 2013


The following commit has been merged in the experimental branch:
commit 6b474953975fd8ea64d1ed4d09c42b2d8e787c6f
Author: Alexander Strange <astrange at ithinksw.com>
Date:   Sat Feb 5 00:28:24 2011 -0500

    Adopt pkt_dts/pkt_pts in lavc clients
    
    No behavior change; this makes DTS reliable with the next patch.
    
    Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

diff --git a/ffmpeg.c b/ffmpeg.c
index b0d3320..371ccd2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1539,7 +1539,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
                     decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
                     /* XXX: allocate picture correctly */
                     avcodec_get_frame_defaults(&picture);
-                    ist->st->codec->reordered_opaque = pkt_pts;
+                    avpkt.pts = pkt_pts;
+                    avpkt.dts = ist->pts;
                     pkt_pts = AV_NOPTS_VALUE;
 
                     ret = avcodec_decode_video2(ist->st->codec,
@@ -1551,7 +1552,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
                         /* no picture yet */
                         goto discard_packet;
                     }
-                    ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, picture.reordered_opaque, ist->pts);
+                    ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, picture.pkt_pts, picture.pkt_dts);
                     if (ist->st->codec->time_base.num != 0) {
                         int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
                         ist->next_pts += ((int64_t)AV_TIME_BASE *
diff --git a/ffplay.c b/ffplay.c
index 21c7205..dbb6268 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1576,11 +1576,11 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
 
     if (got_picture) {
         if (decoder_reorder_pts == -1) {
-            *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, pkt->dts);
+            *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, frame->pkt_dts);
         } else if (decoder_reorder_pts) {
             *pts = frame->pkt_pts;
         } else {
-            *pts = pkt->dts;
+            *pts = frame->pkt_dts;
         }
 
         if (*pts == AV_NOPTS_VALUE) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list