[FFmpeg-devel] [PATCH 2/3] mpegts: unref buffer in reset_pes_packet_state

Marton Balint cus at passwd.hu
Fri May 2 23:26:57 CEST 2014


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mpegts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 1bd697a..7ed7bb4 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -791,9 +791,9 @@ static void reset_pes_packet_state(PESContext *pes)
 {
     pes->pts        = AV_NOPTS_VALUE;
     pes->dts        = AV_NOPTS_VALUE;
-    pes->buffer     = NULL;
     pes->data_index = 0;
     pes->flags      = 0;
+    av_buffer_unref(&pes->buffer);
 }
 
 static void new_pes_packet(PESContext *pes, AVPacket *pkt)
@@ -823,6 +823,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
     pkt->pos   = pes->ts_packet_pos;
     pkt->flags = pes->flags;
 
+    pes->buffer = NULL;
     reset_pes_packet_state(pes);
 }
 
-- 
1.8.4.5



More information about the ffmpeg-devel mailing list