[vlc-devel] [PATCH] demux: mp4: fix ADPCM_IMA_QT sample count calculation

Tristan Matthews tmatth at videolan.org
Sat Oct 27 22:42:45 CEST 2018


Fixes #21348
---
 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 fe4baee4cc..7b7f03cabb 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3838,6 +3838,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;
             }
@@ -3920,6 +3923,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;
             }
-- 
2.17.1



More information about the vlc-devel mailing list