aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorClément Bœsch <cboesch@gopro.com>2017-03-15 14:25:46 +0100
committerClément Bœsch <cboesch@gopro.com>2017-03-15 14:28:43 +0100
commita283665693e1c9804b2736545dba77d0ee342f9e (patch)
tree3caa047a3c52d62b55c1e536befa76d43f6daf87 /ffmpeg.c
parent67e2ba36ec5096a875e377fa1703c535e7eef081 (diff)
parente46a6fb7732a7caef97a916a4f765ec0f779d195 (diff)
downloadffmpeg-a283665693e1c9804b2736545dba77d0ee342f9e.tar.gz
Merge commit 'e46a6fb7732a7caef97a916a4f765ec0f779d195'
* commit 'e46a6fb7732a7caef97a916a4f765ec0f779d195': avconv: Check that muxing_queue exists before reading from it Mostly noop. This was fixed in FFmpeg in 7f7c494a3. The merge makes the cosmetics match but does not include the weird av_log(). Merged-by: Clément Bœsch <cboesch@gopro.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f9fadbd9f2..63fc1bc5f4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -555,12 +555,14 @@ static void ffmpeg_cleanup(int ret)
avcodec_free_context(&ost->enc_ctx);
avcodec_parameters_free(&ost->ref_par);
- while (ost->muxing_queue && av_fifo_size(ost->muxing_queue)) {
- AVPacket pkt;
- av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL);
- av_packet_unref(&pkt);
+ if (ost->muxing_queue) {
+ while (av_fifo_size(ost->muxing_queue)) {
+ AVPacket pkt;
+ av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL);
+ av_packet_unref(&pkt);
+ }
+ av_fifo_freep(&ost->muxing_queue);
}
- av_fifo_freep(&ost->muxing_queue);
av_freep(&output_streams[i]);
}