[SCM] libav/experimental: Fix initialization of avpkt in output_packet().

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:43:52 UTC 2013


The following commit has been merged in the experimental branch:
commit 031e14ea79eea52987d0abc91b10ab6e398842aa
Author: Thilo Borgmann <thilo.borgmann at googlemail.com>
Date:   Sat Apr 11 22:04:52 2009 +0000

    Fix initialization of avpkt in output_packet().
    
    Patch by Thilo Borgmann thilo.surname AT googlemaildotcom.
    
    Originally committed as revision 18451 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/ffmpeg.c b/ffmpeg.c
index 68f84fe..d7c9059 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1185,24 +1185,22 @@ static int output_packet(AVInputStream *ist, int ist_index,
     int got_subtitle;
     AVPacket avpkt;
 
-    av_init_packet(&avpkt);
-
     if(ist->next_pts == AV_NOPTS_VALUE)
         ist->next_pts= ist->pts;
 
     if (pkt == NULL) {
         /* EOF handling */
+        av_init_packet(&avpkt);
         avpkt.data = NULL;
         avpkt.size = 0;
         goto handle_eof;
+    } else {
+        avpkt = *pkt;
     }
 
     if(pkt->dts != AV_NOPTS_VALUE)
         ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
 
-    avpkt.size = pkt->size;
-    avpkt.data = pkt->data;
-
     //while we have more to decode or while the decoder did output something on EOF
     while (avpkt.size > 0 || (!pkt && ist->next_pts != ist->pts)) {
     handle_eof:

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list