mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
qtdemux: fix 16-bit PCM audio advertised with 'raw ' fourcc
'NONE' and 'raw ' fourcc don't always contain U8 audio, it can be more bits as well, in which case it's just like 'twos'. https://bugzilla.gnome.org/show_bug.cgi?id=752613
This commit is contained in:
parent
a55b9060f8
commit
e6381ef285
1 changed files with 10 additions and 9 deletions
|
@ -11730,30 +11730,31 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
gint endian = 0;
|
gint endian = 0;
|
||||||
|
GstAudioFormat format = 0;
|
||||||
|
gint depth;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (qtdemux, "resolve fourcc 0x%08x", GUINT32_TO_BE (fourcc));
|
GST_DEBUG_OBJECT (qtdemux, "resolve fourcc 0x%08x", GUINT32_TO_BE (fourcc));
|
||||||
|
|
||||||
|
depth = stream->bytes_per_packet * 8;
|
||||||
|
|
||||||
switch (fourcc) {
|
switch (fourcc) {
|
||||||
case GST_MAKE_FOURCC ('N', 'O', 'N', 'E'):
|
case GST_MAKE_FOURCC ('N', 'O', 'N', 'E'):
|
||||||
case GST_MAKE_FOURCC ('r', 'a', 'w', ' '):
|
case GST_MAKE_FOURCC ('r', 'a', 'w', ' '):
|
||||||
_codec ("Raw 8-bit PCM audio");
|
/* 8-bit audio is unsigned */
|
||||||
caps = gst_caps_new_simple ("audio/x-raw",
|
if (depth == 8)
|
||||||
"format", G_TYPE_STRING, "U8",
|
format = GST_AUDIO_FORMAT_U8;
|
||||||
"layout", G_TYPE_STRING, "interleaved", NULL);
|
/* otherwise it's signed and big-endian just like 'twos' */
|
||||||
break;
|
|
||||||
case GST_MAKE_FOURCC ('t', 'w', 'o', 's'):
|
case GST_MAKE_FOURCC ('t', 'w', 'o', 's'):
|
||||||
endian = G_BIG_ENDIAN;
|
endian = G_BIG_ENDIAN;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
case GST_MAKE_FOURCC ('s', 'o', 'w', 't'):
|
case GST_MAKE_FOURCC ('s', 'o', 'w', 't'):
|
||||||
{
|
{
|
||||||
gchar *str;
|
gchar *str;
|
||||||
gint depth;
|
|
||||||
GstAudioFormat format;
|
|
||||||
|
|
||||||
if (!endian)
|
if (!endian)
|
||||||
endian = G_LITTLE_ENDIAN;
|
endian = G_LITTLE_ENDIAN;
|
||||||
|
|
||||||
depth = stream->bytes_per_packet * 8;
|
if (!format)
|
||||||
format = gst_audio_format_build_integer (TRUE, endian, depth, depth);
|
format = gst_audio_format_build_integer (TRUE, endian, depth, depth);
|
||||||
|
|
||||||
str = g_strdup_printf ("Raw %d-bit PCM audio", depth);
|
str = g_strdup_printf ("Raw %d-bit PCM audio", depth);
|
||||||
|
|
Loading…
Reference in a new issue