[SCM] libav/experimental: simplify (next_)pts code

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:15:09 UTC 2013


The following commit has been merged in the experimental branch:
commit b1b818fce82dd9acd0493321b3857d329408add9
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Sun Feb 17 17:55:53 2008 +0000

    simplify (next_)pts code
    
    Originally committed as revision 12131 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/ffmpeg.c b/ffmpeg.c
index 170478f..59ce7ca 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1062,17 +1062,14 @@ static int output_packet(AVInputStream *ist, int ist_index,
         goto handle_eof;
     }
 
+    if(pkt->dts != AV_NOPTS_VALUE)
+        ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
+
     len = pkt->size;
     ptr = pkt->data;
     while (len > 0) {
     handle_eof:
-        if(!pkt || ptr != pkt->data || pkt->dts == AV_NOPTS_VALUE){
-            ist->pts= ist->next_pts; // needed for last packet if vsync=0 and for multi pkt
-        } else if (pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too
-            ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
-        } else {
-    //        assert(ist->pts == ist->next_pts);
-        }
+        ist->pts= ist->next_pts;
 
         /* decode the packet if needed */
         data_buf = NULL; /* fail safe */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list