stagefright: make more warnings errors
Change-Id: I9b1ad60fbfb866dbf9c00843e06553c3eb25c113
diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk
index 85ef401..45581f3 100644
--- a/media/libstagefright/Android.mk
+++ b/media/libstagefright/Android.mk
@@ -123,7 +123,7 @@
libdl \
libRScpp \
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 003b09a..beb12ec 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -63,9 +63,11 @@
static const uint8_t kNalUnitTypePicParamSet = 0x08;
static const int64_t kInitialDelayTimeUs = 700000LL;
-static const char kMetaKey_Model[] = "com.android.model";
static const char kMetaKey_Version[] = "com.android.version";
+#ifdef SHOW_MODEL_BUILD
+static const char kMetaKey_Model[] = "com.android.model";
static const char kMetaKey_Build[] = "com.android.build";
+#endif
static const char kMetaKey_CaptureFps[] = "com.android.capture.fps";
/* uncomment to include model and build in meta */
diff --git a/media/libstagefright/MediaCodecListOverrides.cpp b/media/libstagefright/MediaCodecListOverrides.cpp
index 867a223..265b1ea 100644
--- a/media/libstagefright/MediaCodecListOverrides.cpp
+++ b/media/libstagefright/MediaCodecListOverrides.cpp
@@ -302,10 +302,10 @@
char *buf = (char *)malloc(size);
if (fread(buf, size, 1, f) == 1) {
overrides.setTo(buf, size);
-#if LOG_NDEBUG == 0
- ALOGV("Existing overrides:");
- printLongString(buf, size);
-#endif
+ if (!LOG_NDEBUG) {
+ ALOGV("Existing overrides:");
+ printLongString(buf, size);
+ }
} else {
ALOGE("Failed to read %s", fileName);
}
@@ -385,10 +385,10 @@
}
}
-#if LOG_NDEBUG == 0
- ALOGV("New overrides:");
- printLongString(overrides.c_str(), overrides.size());
-#endif
+ if (!LOG_NDEBUG) {
+ ALOGV("New overrides:");
+ printLongString(overrides.c_str(), overrides.size());
+ }
f = fopen(fileName, "wb");
if (f == NULL) {
diff --git a/media/libstagefright/MediaCodecSource.cpp b/media/libstagefright/MediaCodecSource.cpp
index 6568d25..b272448 100644
--- a/media/libstagefright/MediaCodecSource.cpp
+++ b/media/libstagefright/MediaCodecSource.cpp
@@ -682,7 +682,6 @@
size_t size;
int64_t timeUs;
int32_t flags;
- native_handle_t* handle = NULL;
CHECK(msg->findInt32("index", &index));
CHECK(msg->findSize("offset", &offset));
diff --git a/media/libstagefright/filters/Android.mk b/media/libstagefright/filters/Android.mk
index c3eaa54..179f054 100644
--- a/media/libstagefright/filters/Android.mk
+++ b/media/libstagefright/filters/Android.mk
@@ -20,7 +20,7 @@
intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
LOCAL_C_INCLUDES += $(intermediates)
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright_mediafilter
diff --git a/media/libstagefright/foundation/Android.mk b/media/libstagefright/foundation/Android.mk
index 3c95f0b..c68264c 100644
--- a/media/libstagefright/foundation/Android.mk
+++ b/media/libstagefright/foundation/Android.mk
@@ -29,7 +29,7 @@
liblog \
libpowermanager
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright_foundation
diff --git a/media/libstagefright/http/Android.mk b/media/libstagefright/http/Android.mk
index a627898..5fb51c1 100644
--- a/media/libstagefright/http/Android.mk
+++ b/media/libstagefright/http/Android.mk
@@ -21,7 +21,7 @@
LOCAL_CFLAGS += -Wno-multichar
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/httplive/Android.mk b/media/libstagefright/httplive/Android.mk
index a30be66..2639deb 100644
--- a/media/libstagefright/httplive/Android.mk
+++ b/media/libstagefright/httplive/Android.mk
@@ -12,7 +12,7 @@
$(TOP)/frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include/media/openmax
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_SHARED_LIBRARIES := \
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp
index a4e523d..e44b0d9 100644
--- a/media/libstagefright/httplive/PlaylistFetcher.cpp
+++ b/media/libstagefright/httplive/PlaylistFetcher.cpp
@@ -750,8 +750,6 @@
}
void PlaylistFetcher::onMonitorQueue() {
- bool downloadMore = false;
-
// in the middle of an unfinished download, delay
// playlist refresh as it'll change seq numbers
if (!mDownloadState->hasSavedState()) {
diff --git a/media/libstagefright/id3/Android.mk b/media/libstagefright/id3/Android.mk
index f791899..68bd017 100644
--- a/media/libstagefright/id3/Android.mk
+++ b/media/libstagefright/id3/Android.mk
@@ -4,7 +4,7 @@
LOCAL_SRC_FILES := \
ID3.cpp
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE := libstagefright_id3
@@ -18,7 +18,7 @@
LOCAL_SRC_FILES := \
testid3.cpp
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_SHARED_LIBRARIES := \
diff --git a/media/libstagefright/matroska/Android.mk b/media/libstagefright/matroska/Android.mk
index 771952b..1e8c2b2 100644
--- a/media/libstagefright/matroska/Android.mk
+++ b/media/libstagefright/matroska/Android.mk
@@ -8,7 +8,7 @@
$(TOP)/external/libvpx/libwebm \
$(TOP)/frameworks/native/include/media/openmax \
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright_matroska
diff --git a/media/libstagefright/mpeg2ts/Android.mk b/media/libstagefright/mpeg2ts/Android.mk
index 0dcb3c5..16b0160 100644
--- a/media/libstagefright/mpeg2ts/Android.mk
+++ b/media/libstagefright/mpeg2ts/Android.mk
@@ -13,7 +13,7 @@
$(TOP)/frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include/media/openmax
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright_mpeg2ts
diff --git a/media/libstagefright/omx/Android.mk b/media/libstagefright/omx/Android.mk
index 71cbcfc..5f0f567 100644
--- a/media/libstagefright/omx/Android.mk
+++ b/media/libstagefright/omx/Android.mk
@@ -31,7 +31,7 @@
libdl
LOCAL_MODULE:= libstagefright_omx
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/omx/tests/Android.mk b/media/libstagefright/omx/tests/Android.mk
index f7280f6..02e97f1 100644
--- a/media/libstagefright/omx/tests/Android.mk
+++ b/media/libstagefright/omx/tests/Android.mk
@@ -11,7 +11,7 @@
$(TOP)/frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include/media/openmax
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE := omx_tests
@@ -38,7 +38,7 @@
LOCAL_C_INCLUDES := \
frameworks/av/media/libstagefright/omx \
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_NATIVE_TEST)
diff --git a/media/libstagefright/rtsp/Android.mk b/media/libstagefright/rtsp/Android.mk
index 12a946c..c5e8c35 100644
--- a/media/libstagefright/rtsp/Android.mk
+++ b/media/libstagefright/rtsp/Android.mk
@@ -31,7 +31,7 @@
LOCAL_CFLAGS += -Wno-psabi
endif
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
@@ -55,7 +55,7 @@
frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include/media/openmax
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE_TAGS := optional
diff --git a/media/libstagefright/tests/Android.mk b/media/libstagefright/tests/Android.mk
index 532106b..111e6c5 100644
--- a/media/libstagefright/tests/Android.mk
+++ b/media/libstagefright/tests/Android.mk
@@ -31,7 +31,7 @@
frameworks/av/media/libstagefright/include \
$(TOP)/frameworks/native/include/media/openmax \
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_32_BIT_ONLY := true
@@ -63,7 +63,7 @@
frameworks/av/media/libstagefright/include \
$(TOP)/frameworks/native/include/media/openmax \
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_NATIVE_TEST)
@@ -93,7 +93,7 @@
LOCAL_32_BIT_ONLY := true
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_NATIVE_TEST)
diff --git a/media/libstagefright/timedtext/Android.mk b/media/libstagefright/timedtext/Android.mk
index 1202a4d..58fb12f 100644
--- a/media/libstagefright/timedtext/Android.mk
+++ b/media/libstagefright/timedtext/Android.mk
@@ -9,7 +9,7 @@
TimedTextSRTSource.cpp \
TimedTextPlayer.cpp
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_C_INCLUDES:= \
diff --git a/media/libstagefright/timedtext/test/Android.mk b/media/libstagefright/timedtext/test/Android.mk
index 06ea307..e0e0e0d 100644
--- a/media/libstagefright/timedtext/test/Android.mk
+++ b/media/libstagefright/timedtext/test/Android.mk
@@ -26,7 +26,7 @@
libstagefright_foundation \
libutils
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_NATIVE_TEST)
diff --git a/media/libstagefright/webm/Android.mk b/media/libstagefright/webm/Android.mk
index c9fb83c..bc53c56 100644
--- a/media/libstagefright/webm/Android.mk
+++ b/media/libstagefright/webm/Android.mk
@@ -3,7 +3,7 @@
LOCAL_CPPFLAGS += -D__STDINT_LIMITS
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
LOCAL_SRC_FILES:= EbmlUtil.cpp \
diff --git a/media/libstagefright/wifi-display/Android.mk b/media/libstagefright/wifi-display/Android.mk
index 0d9ba6f..fb28624 100644
--- a/media/libstagefright/wifi-display/Android.mk
+++ b/media/libstagefright/wifi-display/Android.mk
@@ -30,7 +30,7 @@
libui \
libutils \
-LOCAL_CFLAGS += -Wno-multichar -Werror
+LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
LOCAL_MODULE:= libstagefright_wfd
diff --git a/media/libstagefright/wifi-display/VideoFormats.cpp b/media/libstagefright/wifi-display/VideoFormats.cpp
index 27393fb..dbc511c 100644
--- a/media/libstagefright/wifi-display/VideoFormats.cpp
+++ b/media/libstagefright/wifi-display/VideoFormats.cpp
@@ -382,7 +382,6 @@
disableAll();
unsigned native, dummy;
- unsigned res[3];
size_t size = strlen(spec);
size_t offset = 0;
diff --git a/media/libstagefright/wifi-display/rtp/RTPSender.cpp b/media/libstagefright/wifi-display/rtp/RTPSender.cpp
index a4eb378..c66a898 100644
--- a/media/libstagefright/wifi-display/rtp/RTPSender.cpp
+++ b/media/libstagefright/wifi-display/rtp/RTPSender.cpp
@@ -252,8 +252,6 @@
int64_t timeUs;
CHECK(tsPackets->meta()->findInt64("timeUs", &timeUs));
- const size_t numTSPackets = tsPackets->size() / 188;
-
size_t srcOffset = 0;
while (srcOffset < tsPackets->size()) {
sp<ABuffer> udpPacket =
diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
index b37a46c..5e2f0bf 100644
--- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp
+++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
@@ -821,21 +821,27 @@
return;
}
+ int64_t delayUs = 1000000; // default delay is 1 sec
int64_t sampleTimeUs;
status_t err = mExtractor->getSampleTime(&sampleTimeUs);
- int64_t nowUs = ALooper::GetNowUs();
+ if (err == OK) {
+ int64_t nowUs = ALooper::GetNowUs();
- if (mFirstSampleTimeRealUs < 0ll) {
- mFirstSampleTimeRealUs = nowUs;
- mFirstSampleTimeUs = sampleTimeUs;
+ if (mFirstSampleTimeRealUs < 0ll) {
+ mFirstSampleTimeRealUs = nowUs;
+ mFirstSampleTimeUs = sampleTimeUs;
+ }
+
+ int64_t whenUs = sampleTimeUs - mFirstSampleTimeUs + mFirstSampleTimeRealUs;
+ delayUs = whenUs - nowUs;
+ } else {
+ ALOGW("could not get sample time (%d)", err);
}
- int64_t whenUs = sampleTimeUs - mFirstSampleTimeUs + mFirstSampleTimeRealUs;
-
sp<AMessage> msg = new AMessage(kWhatPullExtractorSample, this);
msg->setInt32("generation", mPullExtractorGeneration);
- msg->post(whenUs - nowUs);
+ msg->post(delayUs);
mPullExtractorPending = true;
}
diff --git a/media/libstagefright/yuv/Android.mk b/media/libstagefright/yuv/Android.mk
index 5b36825..dc67288 100644
--- a/media/libstagefright/yuv/Android.mk
+++ b/media/libstagefright/yuv/Android.mk
@@ -12,7 +12,7 @@
LOCAL_MODULE:= libstagefright_yuv
-LOCAL_CFLAGS += -Werror
+LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
include $(BUILD_SHARED_LIBRARY)