summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrizio Gennari <fabrizio.ge@tiscali.it>2006-04-21 18:07:10 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-04-21 18:07:10 +0000
commit1ef3722bf6328c3902e9d43c8000c368a3a30a25 (patch)
treea72a740d40e1d05dd50a36f839dd67c6b4552ab6
parent99e0274f1499569afdd957c218a444325f14cdef (diff)
gst/avi/gstavidemux.c: When splitting audio chunks, the block alignment is not taken in consideration, so the smaller...
Original commit message from CVS: Patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it> * gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream), (gst_avi_demux_parse_index), (gst_avi_demux_massage_index): When splitting audio chunks, the block alignment is not taken in consideration, so the smaller chunks could be of size which is not a multiple of the block alignment. Fixes #336904
-rw-r--r--ChangeLog10
-rw-r--r--gst/avi/gstavidemux.c9
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 219d3016..c5e4b3d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2006-04-21 Wim Taymans <wim@fluendo.com>
+ Patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it>
+
+ * gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream),
+ (gst_avi_demux_parse_index), (gst_avi_demux_massage_index):
+ When splitting audio chunks, the block alignment is not taken in
+ consideration, so the smaller chunks could be of size which is
+ not a multiple of the block alignment. Fixes #336904
+
+2006-04-21 Wim Taymans <wim@fluendo.com>
+
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_convert):
Use scale functions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index c91f8145..c6e6cc62 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -1914,11 +1914,18 @@ gst_avi_demux_massage_index (GstAviDemux * avi,
* the allocation of index entries could be improved. */
stream = &avi->stream[entry->stream_nr];
if (entry->dur > MAX_DURATION && stream->strh->type == GST_RIFF_FCC_auds) {
- guint32 ideal_size = stream->strf.auds->av_bps / 10;
+ guint32 ideal_size;
gst_avi_index_entry *entries;
gint old_size, num_added;
GList *one2;
+ /* cut in 1/10th of a second */
+ ideal_size = stream->strf.auds->av_bps / 10;
+
+ /* ensure chunk size is multiple of blockalign */
+ if (stream->strf.auds->blockalign > 1)
+ ideal_size -= ideal_size % stream->strf.auds->blockalign;
+
/* copy index */
old_size = entry->size;
num_added = (entry->size - 1) / ideal_size;