Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
  2. index 48cf637..8ad74e8 100644
  3. --- a/libavcodec/aacdec.c
  4. +++ b/libavcodec/aacdec.c
  5. @@ -457,6 +457,7 @@ static int output_configure(AACContext *ac,
  6. AVCodecContext *avctx = ac->avctx;
  7. int i, channels = 0, ret;
  8. uint64_t layout = 0;
  9. + int type_counts[TYPE_END] = { 0 };
  10.  
  11. if (ac->oc[1].layout_map != layout_map) {
  12. memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
  13. @@ -470,12 +471,14 @@ static int output_configure(AACContext *ac,
  14. for (i = 0; i < tags; i++) {
  15. int type = layout_map[i][0];
  16. int id = layout_map[i][1];
  17. + int iid = type_counts[type]++;
  18. int position = layout_map[i][2];
  19. // Allocate or free elements depending on if they are in the
  20. // current program configuration.
  21. - ret = che_configure(ac, position, type, id, &channels);
  22. + ret = che_configure(ac, position, type, iid, &channels);
  23. if (ret < 0)
  24. return ret;
  25. + ac->tag_che_map[type][id] = ac->che[type][iid];
  26. }
  27. if (ac->oc[1].m4ac.ps == 1 && channels == 2) {
  28. if (layout == AV_CH_FRONT_CENTER) {
  29. @@ -485,7 +488,6 @@ static int output_configure(AACContext *ac,
  30. }
  31. }
  32.  
  33. - memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
  34. if (layout) avctx->channel_layout = layout;
  35. ac->oc[1].channel_layout = layout;
  36. avctx->channels = ac->oc[1].channels = channels;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement