summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-11-14 11:43:40 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-11-14 11:43:40 +0000
commite9d741454d467a44cc04de99c33f5a101baa2a96 (patch)
tree7430681f5657ada9f3d9b587e7cd3ccfe4f26d9b /gst
parentaeea3693aeea1f370b85d67ffdbf446663fa61a8 (diff)
downloadgst-plugins-bad-e9d741454d467a44cc04de99c33f5a101baa2a96.tar.gz
gst-plugins-bad-e9d741454d467a44cc04de99c33f5a101baa2a96.tar.bz2
gst-plugins-bad-e9d741454d467a44cc04de99c33f5a101baa2a96.zip
gst/qtdemux/qtdemux.c: Don't parse extra sample params for raw pcm. Fixes #374914.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_get_duration), (gst_qtdemux_handle_src_query), (qtdemux_parse_trak): Don't parse extra sample params for raw pcm. Fixes #374914.
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 61497619..6d38fa7c 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -3431,14 +3431,15 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
if (compression_id == 0xfffe)
stream->sampled = TRUE;
+ /* first assume uncompressed audio */
+ stream->bytes_per_sample = samplesize / 8;
+ stream->samples_per_frame = stream->n_channels;
+ stream->bytes_per_frame = stream->n_channels * stream->bytes_per_sample;
+ stream->samples_per_packet = stream->samples_per_frame;
+ stream->bytes_per_packet = stream->bytes_per_sample;
+
offset = 52;
if (version == 0x00000000) {
- stream->bytes_per_sample = samplesize / 8;
- stream->samples_per_frame = stream->n_channels;
- stream->bytes_per_frame = stream->n_channels * stream->bytes_per_sample;
- stream->samples_per_packet = stream->samples_per_frame;
- stream->bytes_per_packet = stream->bytes_per_sample;
-
/* Yes, these have to be hard-coded */
if (fourcc == GST_MAKE_FOURCC ('M', 'A', 'C', '6')) {
stream->samples_per_packet = 6;
@@ -3470,19 +3471,21 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
stream->samples_per_frame = 1 * stream->n_channels;
}
} else if (version == 0x00010000) {
- stream->samples_per_packet = QTDEMUX_GUINT32_GET (stsd_data + offset);
- stream->bytes_per_packet = QTDEMUX_GUINT32_GET (stsd_data + offset + 4);
- stream->bytes_per_frame = QTDEMUX_GUINT32_GET (stsd_data + offset + 8);
- stream->bytes_per_sample = QTDEMUX_GUINT32_GET (stsd_data + offset + 12);
-
- GST_LOG ("samples/packet: %d", stream->samples_per_packet);
- GST_LOG ("bytes/packet: %d", stream->bytes_per_packet);
- GST_LOG ("bytes/frame: %d", stream->bytes_per_frame);
- GST_LOG ("bytes/sample: %d", stream->bytes_per_sample);
-
if (fourcc != GST_MAKE_FOURCC ('t', 'w', 'o', 's') &&
fourcc != GST_MAKE_FOURCC ('s', 'o', 'w', 't') &&
fourcc != GST_MAKE_FOURCC ('r', 'a', 'w', ' ')) {
+ /* only parse extra decoding config for non-pcm audio */
+ stream->samples_per_packet = QTDEMUX_GUINT32_GET (stsd_data + offset);
+ stream->bytes_per_packet = QTDEMUX_GUINT32_GET (stsd_data + offset + 4);
+ stream->bytes_per_frame = QTDEMUX_GUINT32_GET (stsd_data + offset + 8);
+ stream->bytes_per_sample =
+ QTDEMUX_GUINT32_GET (stsd_data + offset + 12);
+
+ GST_LOG ("samples/packet: %d", stream->samples_per_packet);
+ GST_LOG ("bytes/packet: %d", stream->bytes_per_packet);
+ GST_LOG ("bytes/frame: %d", stream->bytes_per_frame);
+ GST_LOG ("bytes/sample: %d", stream->bytes_per_sample);
+
if (!stream->sampled) {
stream->samples_per_frame = (stream->bytes_per_frame /
stream->bytes_per_packet) * stream->samples_per_packet;