[FFmpeg-cvslog] r18451 - trunk/ffmpeg.c

stefano subversion
Sun Apr 12 00:04:53 CEST 2009


Author: stefano
Date: Sun Apr 12 00:04:52 2009
New Revision: 18451

Log:
Fix initialization of avpkt in output_packet().

Patch by Thilo Borgmann thilo.surname AT googlemaildotcom.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Sat Apr 11 23:45:57 2009	(r18450)
+++ trunk/ffmpeg.c	Sun Apr 12 00:04:52 2009	(r18451)
@@ -1185,24 +1185,22 @@ static int output_packet(AVInputStream *
     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:



More information about the ffmpeg-cvslog mailing list