mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 15:36:42 +00:00
sys/oss/gstosssink.c: Fix playback of mono streams (bytes_per_sample should be set from the sample width and the numb...
Original commit message from CVS: * sys/oss/gstosssink.c: (gst_oss_sink_prepare): Fix playback of mono streams (bytes_per_sample should be set from the sample width and the number of channels negotiated, and not just be set to 4) (#317338)
This commit is contained in:
parent
c84ad80a51
commit
26745bb132
2 changed files with 18 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-09-27 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* sys/oss/gstosssink.c: (gst_oss_sink_prepare):
|
||||||
|
Fix playback of mono streams (bytes_per_sample should be set
|
||||||
|
from the sample width and the number of channels negotiated,
|
||||||
|
and not just be set to 4) (#317338)
|
||||||
|
|
||||||
2005-09-26 Wim Taymans <wim@fluendo.com>
|
2005-09-26 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/rtp/gstrtpmpaenc.c: (gst_rtpmpaenc_flush),
|
* gst/rtp/gstrtpmpaenc.c: (gst_rtpmpaenc_flush),
|
||||||
|
|
|
@ -325,8 +325,12 @@ gst_oss_sink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
|
||||||
|
|
||||||
spec->segsize = info.fragsize;
|
spec->segsize = info.fragsize;
|
||||||
spec->segtotal = info.fragstotal;
|
spec->segtotal = info.fragstotal;
|
||||||
spec->bytes_per_sample = 4;
|
|
||||||
oss->bytes_per_sample = 4;
|
if (spec->width != 16 && spec->width != 8)
|
||||||
|
goto dodgy_width;
|
||||||
|
|
||||||
|
spec->bytes_per_sample = (spec->width / 8) * spec->channels;
|
||||||
|
oss->bytes_per_sample = (spec->width / 8) * spec->channels;
|
||||||
memset (spec->silence_sample, 0, spec->bytes_per_sample);
|
memset (spec->silence_sample, 0, spec->bytes_per_sample);
|
||||||
|
|
||||||
GST_DEBUG ("got segsize: %d, segtotal: %d, value: %08x", spec->segsize,
|
GST_DEBUG ("got segsize: %d, segtotal: %d, value: %08x", spec->segsize,
|
||||||
|
@ -339,6 +343,11 @@ wrong_format:
|
||||||
GST_DEBUG ("wrong format %d\n", spec->format);
|
GST_DEBUG ("wrong format %d\n", spec->format);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
dodgy_width:
|
||||||
|
{
|
||||||
|
GST_DEBUG ("unexpected width %d\n", spec->width);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue