summaryrefslogtreecommitdiff
path: root/gst/avi
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-04-27 13:53:00 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-04-27 13:54:31 +0300
commit34dc1298e9c03a6f2f8f367b344b4c6525bd1d83 (patch)
treecb123e991d8b172591f8eb2686a6dc229d16e4f3 /gst/avi
parent63c284c24ec08c8cdf976f819bcd20868766e57f (diff)
downloadgstreamer-plugins-good-34dc1298e9c03a6f2f8f367b344b4c6525bd1d83.tar.gz
avimux: Actually store the largest audio chunk size for the VBR case of MP2/MP3
3ea338ce271e1f6a96d2ed49d4472b091f6f8b7e changed avimux to do that, but it never actually kept track of the max audio chunk for MP3 and MP2. These are knowing the hdr.scale only after parsing the frames instead of at setcaps time.
Diffstat (limited to 'gst/avi')
-rw-r--r--gst/avi/gstavimux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c
index 222d863d8..b28a0174a 100644
--- a/gst/avi/gstavimux.c
+++ b/gst/avi/gstavimux.c
@@ -643,6 +643,9 @@ refuse_caps:
}
}
+static void gst_avi_mux_audsink_set_fields (GstAviMux * avimux,
+ GstAviAudioPad * avipad);
+
static GstFlowReturn
gst_avi_mux_audsink_scan_mpeg_audio (GstAviMux * avimux, GstAviPad * avipad,
GstBuffer * buffer)
@@ -687,9 +690,10 @@ gst_avi_mux_audsink_scan_mpeg_audio (GstAviMux * avimux, GstAviPad * avipad,
spf = 576;
}
- if (G_UNLIKELY (avipad->hdr.scale <= 1))
+ if (G_UNLIKELY (avipad->hdr.scale <= 1)) {
avipad->hdr.scale = spf;
- else if (G_UNLIKELY (avipad->hdr.scale != spf)) {
+ gst_avi_mux_audsink_set_fields (avimux, (GstAviAudioPad *) avipad);
+ } else if (G_UNLIKELY (avipad->hdr.scale != spf)) {
GST_WARNING_OBJECT (avimux, "input mpeg audio has varying frame size");
goto cbr_fallback;
}
@@ -708,6 +712,7 @@ cbr_fallback:
{
GST_WARNING_OBJECT (avimux, "falling back to CBR muxing");
avipad->hdr.scale = 1;
+ gst_avi_mux_audsink_set_fields (avimux, (GstAviAudioPad *) avipad);
/* no need to check further */
avipad->hook = NULL;
goto done;