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

Tristan Matthews git at videolan.org
Sun Oct 28 18:23:31 CET 2018


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Sat Oct 27 16:38:43 2018 -0400| [70ff126da4182184fc20a58a9c035e5dd8c8ae5a] | committer: Tristan Matthews

demux: mp4: fix ADPCM_IMA_QT sample count calculation

Fixes #21348

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=70ff126da4182184fc20a58a9c035e5dd8c8ae5a
---

 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;
             }



More information about the vlc-commits mailing list