From: Jan Sebechlebsky <sebechlebsky...@gmail.com>

Replace av_copy_packet and deprecated av_dup_packet by
creating reference using av_packet_ref.

Signed-off-by: Jan Sebechlebsky <sebechlebsky...@gmail.com>
---
 This should be effectively the same as calling av_packet_clone,
 but without dynamic memory allocation (reuses local AVPacket pkt).
 
 libavformat/tee.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 879d5b8..1891f9b 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -527,8 +527,8 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket 
*pkt)
         if (s2 < 0)
             continue;
 
-        if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
-            (ret = av_dup_packet(&pkt2))< 0)
+        memset(&pkt2, 0, sizeof(AVPacket));
+        if ((ret = av_packet_ref(&pkt2, pkt)) < 0)
             if (!ret_all) {
                 ret_all = ret;
                 continue;
-- 
1.9.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to