From 35bb1028e16579b4848704bcde70056ebe98091d Mon Sep 17 00:00:00 2001 From: Jeremy Noring Date: Wed, 7 Jan 2015 18:17:52 -0200 Subject: [PATCH] backport commit r501 fix for issue 150 ; mp4v2 incorrectly reports track bitrate in the absence of the avgBitrate track property. thanks to ktakata65536 for the patch. --- src/mp4.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mp4.cpp b/src/mp4.cpp index 3605298..e1ea9fd 100644 --- a/src/mp4.cpp +++ b/src/mp4.cpp @@ -2402,8 +2402,11 @@ MP4FileHandle MP4ReadProvider( const char* fileName, const MP4FileProvider* file if (MP4_IS_VALID_FILE_HANDLE(hFile)) { MP4File *pFile = (MP4File *)hFile; try { - return pFile->GetTrackIntegerProperty(trackId, + uint32_t bitrate = pFile->GetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.*.esds.decConfigDescr.avgBitrate"); + if(bitrate != 0) { + return bitrate; + } } catch( Exception* x ) { //mp4v2::impl::log.errorf(*x); we don't really need to print this. -- 2.7.4