Merge "C2SoftVorbisDec: Ignore subsequent headers" into qt-dev
am: 669dda14bd

Change-Id: I11f165d74080755f8d87c6cc2f7d1f614c6de084
diff --git a/media/codec2/components/vorbis/C2SoftVorbisDec.cpp b/media/codec2/components/vorbis/C2SoftVorbisDec.cpp
index e7393ee..e3bafd3 100644
--- a/media/codec2/components/vorbis/C2SoftVorbisDec.cpp
+++ b/media/codec2/components/vorbis/C2SoftVorbisDec.cpp
@@ -270,7 +270,8 @@
     const uint8_t *data = rView.data() + inOffset;
     int32_t numChannels  = mVi->channels;
     int32_t samplingRate = mVi->rate;
-    if (inSize > 7 && !memcmp(&data[1], "vorbis", 6)) {
+    /* Decode vorbis headers only once */
+    if (inSize > 7 && !memcmp(&data[1], "vorbis", 6) && (!mInfoUnpacked || !mBooksUnpacked)) {
         if ((data[0] != 1) && (data[0] != 5)) {
             ALOGE("unexpected type received %d", data[0]);
             mSignalledError = true;