diff --git a/ffmpeg.c b/ffmpeg.c
index 300bb5e9b15101b9a95a32bc6d9a5787dba51450..38aebe4d226c5ae3dd703188fb31628269e90462 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1698,7 +1698,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
                         av_init_packet(&opkt);
 
                         if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && !copy_initial_nonkeyframes)
-                            continue;
+                            goto cont;
 
                         /* no reencoding needed : output the packet directly */
                         /* force the input stream PTS */
@@ -1746,6 +1746,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
                         ost->frame_number++;
                         av_free_packet(&opkt);
                     }
+                    cont:
 #if CONFIG_AVFILTER
                     frame_available = (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
                                        ost->output_video_filter && avfilter_poll_frame(ost->output_video_filter->inputs[0]);