[vlc-commits] demux: mp4: fix ADPCM_IMA_QT sample count calculation
Tristan Matthews
git at videolan.org
Sun Oct 28 21:42:34 CET 2018
vlc/vlc-3.0 | branch: master | Tristan Matthews <tmatth at videolan.org> | Sat Oct 27 16:38:43 2018 -0400| [d291a46269c886e99412a37c27045a64d89c03dd] | committer: Tristan Matthews
demux: mp4: fix ADPCM_IMA_QT sample count calculation
Fixes #21348
(cherry picked from commit 70ff126da4182184fc20a58a9c035e5dd8c8ae5a)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d291a46269c886e99412a37c27045a64d89c03dd
---
modules/demux/mp4/mp4.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 6862c71723..ccb4810318 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3711,6 +3711,9 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
case VLC_CODEC_GSM:
*pi_nb_samples = 160 * p_track->fmt.audio.i_channels;
return 33 * p_track->fmt.audio.i_channels;
+ case VLC_CODEC_ADPCM_IMA_QT:
+ *pi_nb_samples = 64 * p_track->fmt.audio.i_channels;
+ return 34 * p_track->fmt.audio.i_channels;
default:
break;
}
@@ -3793,6 +3796,10 @@ static uint64_t MP4_TrackGetPos( mp4_track_t *p_track )
i_pos += ( p_track->i_sample -
p_track->chunk[p_track->i_chunk].i_sample_first ) / 160 * 33;
return i_pos;
+ case VLC_CODEC_ADPCM_IMA_QT: /* # Samples > data size */
+ i_pos += ( p_track->i_sample -
+ p_track->chunk[p_track->i_chunk].i_sample_first ) / 64 * 34;
+ return i_pos;
default:
break;
}
More information about the vlc-commits
mailing list