]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mux.c
tty: set avg_frame_rate.
[ffmpeg] / libavformat / mux.c
index 96eecb5a93f1cc0c58b760083450104a9e8bbf3b..cb3c297a6b8b65193c571895f289aaa20fdd4db1 100644 (file)
@@ -305,7 +305,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
             return ret;
     }
 
-    if ((ret = init_pts(s) < 0))
+    if ((ret = init_pts(s)) < 0)
         return ret;
 
     return 0;
@@ -420,7 +420,10 @@ void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
 
     this_pktl      = av_mallocz(sizeof(AVPacketList));
     this_pktl->pkt = *pkt;
+#if FF_API_DESTRUCT_PACKET
     pkt->destruct  = NULL;           // do not free original but only the copy
+#endif
+    pkt->buf       = NULL;
     av_dup_packet(&this_pktl->pkt);  // duplicate the packet if it uses non-alloced memory
 
     if (s->streams[pkt->stream_index]->last_in_packet_buffer) {