summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-03-11 15:44:16 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-03-11 15:44:16 +0200
commit34fe6af6da642d58a254ebe2c045af353c8fb52f (patch)
treeab4fe2943feac73b15d7de339878ad89a5b890a2
parent6655aabebccdf390804b3e35663dfe97151200b8 (diff)
downloadgst-libav-34fe6af6da642d58a254ebe2c045af353c8fb52f.tar.gz
avcodecmap: Only set the bitrate if we actually got it from the caps
Otherwise we set a random value from the stack as bitrate. The default (0) is a better choice and doesn't upset valgrind.
-rw-r--r--ext/libav/gstavcodecmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
index 966c9b8..0a32923 100644
--- a/ext/libav/gstavcodecmap.c
+++ b/ext/libav/gstavcodecmap.c
@@ -2366,8 +2366,8 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
gst_structure_get_int (structure, "channels", &context->channels);
gst_structure_get_int (structure, "rate", &context->sample_rate);
gst_structure_get_int (structure, "block_align", &context->block_align);
- gst_structure_get_int (structure, "bitrate", &bitrate);
- context->bit_rate = bitrate;
+ if (gst_structure_get_int (structure, "bitrate", &bitrate))
+ context->bit_rate = bitrate;
if (!raw)
return;