gst/avi/gstavimux.c: Minor fix/cleanup in header field calculation.

Original commit message from CVS:
* gst/avi/gstavimux.c: (gst_avi_mux_audsink_set_caps):
Minor fix/cleanup in header field calculation.
This commit is contained in:
Mark Nauwelaerts 2009-01-07 09:43:13 +00:00
parent 85c6c25264
commit 24eed322dc
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2009-01-07 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
* gst/avi/gstavimux.c: (gst_avi_mux_audsink_set_caps):
Minor fix/cleanup in header field calculation.
2009-01-06 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> 2009-01-06 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
* gst/matroska/matroska-mux.c: (gst_matroska_mux_reset), * gst/matroska/matroska-mux.c: (gst_matroska_mux_reset),

View file

@ -738,7 +738,6 @@ gst_avi_mux_audsink_set_caps (GstPad * pad, GstCaps * vscaps)
avipad->auds.av_bps = avipad->auds.blockalign * avipad->auds.rate; avipad->auds.av_bps = avipad->auds.blockalign * avipad->auds.rate;
} else if (!strcmp (mimetype, "audio/x-mulaw")) { } else if (!strcmp (mimetype, "audio/x-mulaw")) {
avipad->auds.format = GST_RIFF_WAVE_FORMAT_MULAW; avipad->auds.format = GST_RIFF_WAVE_FORMAT_MULAW;
avipad->auds.av_bps = 8;
avipad->auds.size = 8; avipad->auds.size = 8;
avipad->auds.blockalign = avipad->auds.channels; avipad->auds.blockalign = avipad->auds.channels;
avipad->auds.av_bps = avipad->auds.blockalign * avipad->auds.rate; avipad->auds.av_bps = avipad->auds.blockalign * avipad->auds.rate;
@ -748,7 +747,9 @@ gst_avi_mux_audsink_set_caps (GstPad * pad, GstCaps * vscaps)
if (!avipad->auds.format) if (!avipad->auds.format)
goto refuse_caps; goto refuse_caps;
avipad->parent.hdr.rate = avipad->auds.rate; /* by spec, hdr.rate is av_bps related, is calculated that way in stop_file,
* and reduces to sample rate in PCM like cases */
avipad->parent.hdr.rate = avipad->auds.av_bps / avipad->auds.blockalign;
avipad->parent.hdr.samplesize = avipad->auds.blockalign; avipad->parent.hdr.samplesize = avipad->auds.blockalign;
avipad->parent.hdr.scale = 1; avipad->parent.hdr.scale = 1;