]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix initialization of avpkt in output_packet().
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 22:04:52 +0000 (22:04 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 22:04:52 +0000 (22:04 +0000)
Patch by Thilo Borgmann thilo.surname AT googlemaildotcom.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18451 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffmpeg.c

index 68f84fe57550020617035330f7d2a9a1f3255b42..d7c90599d0f829c2f3ebec3789934a27827b6492 100644 (file)
--- 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: