On 2018年05月14日 20:17, Zhao Zhili wrote:
From: Zhao Zhili <wantl...@gmail.com>

---
  doc/examples/filtering_video.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
index 38ff9bb..225dccc 100644
--- a/doc/examples/filtering_video.c
+++ b/doc/examples/filtering_video.c
@@ -233,6 +233,7 @@ int main(int argc, char **argv)
if (packet.stream_index == video_stream_index) {
              ret = avcodec_send_packet(dec_ctx, &packet);
+            av_packet_unref(&packet);
              if (ret < 0) {
                  av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the 
decoder\n");
                  break;
@@ -269,8 +270,9 @@ int main(int argc, char **argv)
                      av_frame_unref(frame);
                  }
              }
+        } else {
+            av_packet_unref(&packet);
          }
-        av_packet_unref(&packet);
      }
  end:
      avfilter_graph_free(&filter_graph);

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

Reply via email to