SHARE
TWEET

Untitled

a guest Jul 4th, 2014 277 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/lib/rbcodec/codecs/libm4a/demux.c b/lib/rbcodec/codecs/libm4a/demux.c
  2. index 3bf46ef..6ed8756 100644
  3. --- a/lib/rbcodec/codecs/libm4a/demux.c
  4. +++ b/lib/rbcodec/codecs/libm4a/demux.c
  5. @@ -65,7 +65,8 @@ static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len)
  6.          (type != MAKEFOURCC('m','p','4','2')) &&
  7.          (type != MAKEFOURCC('3','g','p','6')) &&
  8.          (type != MAKEFOURCC('q','t',' ',' ')) &&
  9. -        (type != MAKEFOURCC('i','s','o','m')))
  10. +        (type != MAKEFOURCC('i','s','o','m')) &&
  11. +        (type != MAKEFOURCC('M','4','A','\0')))
  12.      {
  13.          DEBUGF("not M4A file\n");
  14.          return;
  15. @@ -425,6 +426,7 @@ static bool read_chunk_stco(qtmovie_t *qtmovie, size_t chunk_len)
  16.  {
  17.      uint32_t i, k, old_i;
  18.      uint32_t numentries;
  19. +    uint32_t table_reduce_factor;
  20.      uint32_t idx = 0;
  21.      uint32_t frame;
  22.      uint32_t offset;
  23. @@ -440,9 +442,12 @@ static bool read_chunk_stco(qtmovie_t *qtmovie, size_t chunk_len)
  24.      numentries = stream_read_uint32(qtmovie->stream);
  25.      size_remaining -= 4;
  26.    
  27. -    qtmovie->res->num_lookup_table = numentries;
  28. -    qtmovie->res->lookup_table = malloc(numentries * sizeof(*qtmovie->res->lookup_table));
  29. -
  30. +    for (i = 0; !qtmovie->res->lookup_table; ++i) {
  31. +      qtmovie->res->lookup_table = malloc((numentries >> i) * sizeof(*qtmovie->res->lookup_table));
  32. +    }
  33. +    table_reduce_factor = i > 0 ? i - 1 : 0;
  34. +    qtmovie->res->num_lookup_table = numentries >> table_reduce_factor;
  35. +    
  36.      if (!qtmovie->res->lookup_table)
  37.      {
  38.          DEBUGF("stco too large to allocate lookup_table[]\n");
  39. @@ -489,10 +494,11 @@ static bool read_chunk_stco(qtmovie_t *qtmovie, size_t chunk_len)
  40.              frame += (new_first - old_first) * old_frame;
  41.          }
  42.          frame += (k - old_first) * old_frame;
  43. -        
  44. -        qtmovie->res->lookup_table[idx].sample = frame;
  45. -        qtmovie->res->lookup_table[idx].offset = offset;
  46. -        idx++;
  47. +        if (!(k % (1 << table_reduce_factor))) {
  48. +            qtmovie->res->lookup_table[idx].sample = frame;
  49. +            qtmovie->res->lookup_table[idx].offset = offset;
  50. +            idx++;
  51. +        }
  52.          
  53.          frame -= (k - old_first) * old_frame;
  54.          
  55. diff --git a/lib/rbcodec/metadata/mp4.c b/lib/rbcodec/metadata/mp4.c
  56. index 6973d3a..d1fc6f4 100644
  57. --- a/lib/rbcodec/metadata/mp4.c
  58. +++ b/lib/rbcodec/metadata/mp4.c
  59. @@ -605,7 +605,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
  60.                  
  61.                  if ((id != MP4_M4A) && (id != MP4_M4B) && (id != MP4_mp42)
  62.                      && (id != MP4_qt) && (id != MP4_3gp6) && (id != MP4_m4a)
  63. -                    && (id != MP4_isom))
  64. +                    && (id != MP4_isom) && id != 1295270144)
  65.                  {
  66.                      DEBUGF("Unknown MP4 file type: '%c%c%c%c'\n",
  67.                          (int)(id >> 24 & 0xff), (int)(id >> 16 & 0xff),
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top