diff options
author | Fabrizio Gennari <fabrizio.ge@tiscali.it> | 2006-04-21 18:07:10 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-04-21 18:07:10 +0000 |
commit | 1ef3722bf6328c3902e9d43c8000c368a3a30a25 (patch) | |
tree | a72a740d40e1d05dd50a36f839dd67c6b4552ab6 /gst | |
parent | 99e0274f1499569afdd957c218a444325f14cdef (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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavidemux.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; |