summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2020-06-18 22:16:30 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-06-20 00:36:48 +0000
commite2c4828699911d906640fde09c185693f3848e7b (patch)
tree5fb73542eb05d6ea2d045dc9199d18c47da316a2
parentedf2ac85db4dc512f11e7ad0158034ea30e720c6 (diff)
downloadgst-libav-e2c4828699911d906640fde09c185693f3848e7b.tar.gz
avmux: zero-initialize packets
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/76>
-rw-r--r--ext/libav/gstavmux.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/libav/gstavmux.c b/ext/libav/gstavmux.c
index 30c7047..325a79d 100644
--- a/ext/libav/gstavmux.c
+++ b/ext/libav/gstavmux.c
@@ -729,7 +729,7 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
* no buffers left */
if (best_pad != NULL) {
GstBuffer *buf;
- AVPacket pkt;
+ AVPacket pkt = { 0, };
GstMapInfo map;
/* push out current buffer */
@@ -746,7 +746,6 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
pkt.size = map.size;
pkt.stream_index = best_pad->padnum;
- pkt.flags = 0;
if (!GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT))
pkt.flags |= AV_PKT_FLAG_KEY;
@@ -755,8 +754,6 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
pkt.duration =
gst_ffmpeg_time_gst_to_ff (GST_BUFFER_DURATION (buf),
ffmpegmux->context->streams[best_pad->padnum]->time_base);
- else
- pkt.duration = 0;
av_write_frame (ffmpegmux->context, &pkt);
gst_buffer_unmap (buf, &map);
gst_buffer_unref (buf);