summaryrefslogtreecommitdiff
path: root/gst/isomp4/qtdemux.c
diff options
context:
space:
mode:
authorManasa Athreya <manasa.athreya@lge.com>2015-07-27 13:34:14 +0900
committerTim-Philipp Müller <tim@centricular.com>2015-07-27 19:06:43 +0100
commite6381ef285ca6e0c909b1ad6cba6183fe1ac435d (patch)
tree3647bba352ecb3f30bf419c7a05fdc0adac40287 /gst/isomp4/qtdemux.c
parenta55b9060f8956fd41b6400d18fbda77c99260c66 (diff)
downloadgstreamer-plugins-good-e6381ef285ca6e0c909b1ad6cba6183fe1ac435d.tar.gz
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
Diffstat (limited to 'gst/isomp4/qtdemux.c')
-rw-r--r--gst/isomp4/qtdemux.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index f796735b8..6a52021d4 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -11730,31 +11730,32 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
const GstStructure *s;
const gchar *name;
gint endian = 0;
+ GstAudioFormat format = 0;
+ gint depth;
GST_DEBUG_OBJECT (qtdemux, "resolve fourcc 0x%08x", GUINT32_TO_BE (fourcc));
+ depth = stream->bytes_per_packet * 8;
+
switch (fourcc) {
case GST_MAKE_FOURCC ('N', 'O', 'N', 'E'):
case GST_MAKE_FOURCC ('r', 'a', 'w', ' '):
- _codec ("Raw 8-bit PCM audio");
- caps = gst_caps_new_simple ("audio/x-raw",
- "format", G_TYPE_STRING, "U8",
- "layout", G_TYPE_STRING, "interleaved", NULL);
- break;
+ /* 8-bit audio is unsigned */
+ if (depth == 8)
+ format = GST_AUDIO_FORMAT_U8;
+ /* otherwise it's signed and big-endian just like 'twos' */
case GST_MAKE_FOURCC ('t', 'w', 'o', 's'):
endian = G_BIG_ENDIAN;
/* fall-through */
case GST_MAKE_FOURCC ('s', 'o', 'w', 't'):
{
gchar *str;
- gint depth;
- GstAudioFormat format;
if (!endian)
endian = G_LITTLE_ENDIAN;
- depth = stream->bytes_per_packet * 8;
- format = gst_audio_format_build_integer (TRUE, endian, depth, depth);
+ if (!format)
+ format = gst_audio_format_build_integer (TRUE, endian, depth, depth);
str = g_strdup_printf ("Raw %d-bit PCM audio", depth);
_codec (str);