hal: fix variable initialization am: e3afca2e12
am: 21b4490dd4

Change-Id: I778809ecbe1113f9160dad51fb5abebb31594d13
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 35b42c3..08d5622 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2223,6 +2223,9 @@
     int error_code = ERROR_CODE_STANDBY;
 
     lock_output_stream(out);
+    // this is always nonzero
+    const int frame_size = audio_stream_out_frame_size(stream);
+
     if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
         error_code = ERROR_CODE_WRITE;
         goto exit;
@@ -2244,9 +2247,6 @@
         }
     }
 
-    // this is always nonzero
-    const size_t frame_size = audio_stream_out_frame_size(stream);
-
     if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
         ALOGVV("%s: writing buffer (%zu bytes) to compress device", __func__, bytes);
         if (out->send_new_metadata) {