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.
This commit is contained in:
Sebastian Dröge 2016-03-11 15:44:16 +02:00
parent 6655aabebc
commit 34fe6af6da

View file

@ -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;