avimux: set audio header rate according to calculated bps in stop_file

... now that set_fields is no longer called there by
e538608b3f
This commit is contained in:
Mark Nauwelaerts 2016-05-01 15:09:27 +02:00
parent e0b26059ae
commit eb336a804b

View file

@ -1830,6 +1830,9 @@ gst_avi_mux_stop_file (GstAviMux * avimux)
audpad->auds.blockalign = audpad->max_audio_chunk;
if (audpad->auds.blockalign == 0)
audpad->auds.blockalign = 1;
/* note that hdr.rate is actually used by demux in cbr case */
if (avipad->hdr.scale <= 1)
avipad->hdr.rate = audpad->auds.av_bps / audpad->auds.blockalign;
avimux->avi_hdr.max_bps += audpad->auds.av_bps;
avipad->hdr.length = gst_util_uint64_scale (audpad->audio_time,
avipad->hdr.rate, avipad->hdr.scale * GST_SECOND);