summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-03-14 05:43:33 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-03-14 05:43:33 +0000
commitca3eaf9764e93cd7e8b71181b074948de1c11269 (patch)
treeb89a77ce6dc9d9c2de749d490b98d2b642b5c021 /gst/qtdemux
parentadf3889a893a17a27e2f814b5ae7ba1b4f020ed4 (diff)
downloadgst-plugins-bad-ca3eaf9764e93cd7e8b71181b074948de1c11269.tar.gz
gst-plugins-bad-ca3eaf9764e93cd7e8b71181b074948de1c11269.tar.bz2
gst-plugins-bad-ca3eaf9764e93cd7e8b71181b074948de1c11269.zip
gst/qtdemux/qtdemux.c: Fix for obvious mistake, where we first shift the offset and then read a samplesize element as...
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak): Fix for obvious mistake, where we first shift the offset and then read a samplesize element assuming the old offset. Note that this part still has something weird, i.e. my movies containing those don't actually play well, but at least there's something that looks like sound now.
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/qtdemux.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 8da138a9..4826821b 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -1451,7 +1451,7 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET(stsd->data+offset+4)),
stream->caps);
}else if(stream->subtype == FOURCC_soun){
- int version;
+ int version, samplesize;
GST_LOG("st type: " GST_FOURCC_FORMAT "\n",
GST_FOURCC_ARGS(QTDEMUX_FOURCC_GET(stsd->data+16+4)));
@@ -1463,6 +1463,7 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
GST_LOG("n_channels: %d\n", QTDEMUX_GUINT16_GET(stsd->data+offset + 8));
stream->n_channels = QTDEMUX_GUINT16_GET(stsd->data+offset + 8);
GST_LOG("sample_size: %d\n", QTDEMUX_GUINT16_GET(stsd->data+offset + 10));
+ samplesize = QTDEMUX_GUINT16_GET(stsd->data+offset + 10);
GST_LOG("compression_id: %d\n", QTDEMUX_GUINT16_GET(stsd->data+offset + 12));
GST_LOG("packet size: %d\n", QTDEMUX_GUINT16_GET(stsd->data+offset + 14));
GST_LOG("sample rate: %g\n", QTDEMUX_FP32_GET(stsd->data+offset + 16));
@@ -1478,7 +1479,7 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
GST_LOG("bytes/sample: %d\n", QTDEMUX_GUINT32_GET(stsd->data+offset + 12));
offset = 68;
} else {
- stream->bytes_per_frame = stream->n_channels * QTDEMUX_GUINT16_GET(stsd->data+offset + 10);
+ stream->bytes_per_frame = stream->n_channels * samplesize / 8;
stream->samples_per_packet = 1;
}