memcpy(&audio_data_header, pending_buffer + sizeof(streaming_data_header),
sizeof(streaming_data_audio_data_header));
+ static bool start_received = false;
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_CONTINUE && !start_received) {
+ MA_SLOGE("[ERROR] CONTINUE without START, forcing to emit START event");
+ audio_data_header.event = MA_AUDIO_STREAMING_EVENT_START;
+ }
+
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_START) start_received = true;
+ /* Reset if FINISHED received */
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_FINISH) start_received = false;
+
/* Don't invoke audio streaming callback for CONTINUE audio events
if the streaming request is no more valid, since it would not provide
any useful information to the client application */
__ma_ap_cb_audio_streaming(audio_data_header.event,
pending_buffer + sizeof(streaming_data_header) + sizeof(streaming_data_audio_data_header),
audio_data_header.data_size);
- if (0 == header.streaming_data_serial % 50 || MA_AUDIO_STREAMING_EVENT_FINISH == audio_data_header.event) {
- MA_SLOGE("__ma_ap_cb_audio_streaming() called, serial : %d", header.streaming_data_serial);
+ if (0 == header.streaming_data_serial % 50 || MA_AUDIO_STREAMING_EVENT_CONTINUE != audio_data_header.event) {
+ MA_SLOGE("__ma_ap_cb_audio_streaming() called, event and serial : %d %d",
+ audio_data_header.event, header.streaming_data_serial);
}
}
} else if (streaming_data_type_streaming_section == header.streaming_data_type) {
memcpy(&audio_data_header, pending_buffer + sizeof(streaming_data_header),
sizeof(streaming_data_audio_data_header));
+ static bool start_received = false;
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_CONTINUE && !start_received) {
+ MA_SLOGE("[ERROR] CONTINUE without START, forcing to emit START event");
+ audio_data_header.event = MA_AUDIO_STREAMING_EVENT_START;
+ }
+
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_START) start_received = true;
+ /* Reset if FINISHED received */
+ if (audio_data_header.event == MA_AUDIO_STREAMING_EVENT_FINISH) start_received = false;
+
/* Don't invoke audio streaming callback for CONTINUE audio events
if the streaming request is no more valid, since it would not provide
any useful information to the client application */
__ma_cb_audio_streaming(audio_data_header.event,
pending_buffer + sizeof(streaming_data_header) + sizeof(streaming_data_audio_data_header),
audio_data_header.data_size);
- if (0 == header.streaming_data_serial % 50 || MA_AUDIO_STREAMING_EVENT_FINISH == audio_data_header.event) {
- MA_SLOGE("__ma_cb_audio_streaming() called, serial : %d", header.streaming_data_serial); //LCOV_EXCL_LINE
+ if (0 == header.streaming_data_serial % 50 || MA_AUDIO_STREAMING_EVENT_CONTINUE != audio_data_header.event) {
+ MA_SLOGE("__ma_ap_cb_audio_streaming() called, event and serial : %d %d",
+ audio_data_header.event, header.streaming_data_serial);
}
}
} else if (streaming_data_type_streaming_section == header.streaming_data_type) {