Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ffplay.c b/ffplay.c
index a879471bbe..6668007fd6 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1632,6 +1632,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
static int video_thread(void *arg)
{
+ AVPacket pkt = { 0 };
VideoState *is = arg;
AVFrame *frame = avcodec_alloc_frame();
int64_t pts_int = AV_NOPTS_VALUE, pos = -1;
@@ -1655,7 +1656,6 @@ static int video_thread(void *arg)
#endif
for (;;) {
- AVPacket pkt;
#if CONFIG_AVFILTER
AVFilterBufferRef *picref;
AVRational tb;
@@ -1664,14 +1664,14 @@ static int video_thread(void *arg)
SDL_Delay(10);
avcodec_get_frame_defaults(frame);
+ av_free_packet(&pkt);
+
ret = get_video_frame(is, frame, &pts_int, &pkt);
if (ret < 0)
goto the_end;
- if (!ret) {
- av_free_packet(&pkt);
+ if (!ret)
continue;
- }
#if CONFIG_AVFILTER
if ( last_w != is->video_st->codec->width
@@ -1766,6 +1766,7 @@ static int video_thread(void *arg)
av_freep(&vfilters);
avfilter_graph_free(&graph);
#endif
+ av_free_packet(&pkt);
av_free(frame);
return 0;
}