Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.70 KB | None | 0 0
  1. From: Hendrik Leppkes <h.leppkes@gmail.com>
  2. Date: Wed, 29 Mar 2017 22:46:53 +0000 (+0200)
  3. Subject: aacdec: track pce directly instead of overriding chan_config
  4.  
  5. aacdec: track pce directly instead of overriding chan_config
  6.  
  7. Modifying chan_config results in LATM decoding re-initializating every frame.
  8. ---
  9.  
  10. diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
  11. index ec8b7c3b11..b3010698e3 100644
  12. --- a/libavcodec/aacdec_template.c
  13. +++ b/libavcodec/aacdec_template.c
  14. @@ -557,7 +557,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
  15.  {
  16.      /* For PCE based channel configurations map the channels solely based
  17.       * on tags. */
  18. -    if (!ac->oc[1].m4ac.chan_config) {
  19. +    if (!ac->oc[1].m4ac.chan_config || ac->oc[1].m4ac.pce) {
  20.          return ac->tag_che_map[type][elem_id];
  21.      }
  22.      // Allow single CPE stereo files to be signalled with mono configuration.
  23. @@ -3040,7 +3040,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
  24.              } else {
  25.                  err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
  26.                  if (!err)
  27. -                    ac->oc[1].m4ac.chan_config = 0;
  28. +                    ac->oc[1].m4ac.pce = 1;
  29.                  pce_found = 1;
  30.              }
  31.              break;
  32. diff --git a/libavcodec/mpeg4audio.h b/libavcodec/mpeg4audio.h
  33. index 8fd32f96b3..178bef26e2 100644
  34. --- a/libavcodec/mpeg4audio.h
  35. +++ b/libavcodec/mpeg4audio.h
  36. @@ -39,6 +39,7 @@ typedef struct MPEG4AudioConfig {
  37.      int channels;
  38.      int ps;  ///< -1 implicit, 1 presence
  39.      int frame_length_short;
  40. +    int pce;
  41.  } MPEG4AudioConfig;
  42.  
  43.  extern av_export const int avpriv_mpeg4audio_sample_rates[16];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement