OSDN Git Service

android/hal-audio: Always call qos_update
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Mon, 2 Jun 2014 16:37:47 +0000 (18:37 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 6 Jun 2014 08:27:45 +0000 (11:27 +0300)
As it turned out, it's better to always call update_qos and just
provide dummy callback from codecs which do not support it.

android/hal-audio.c

index 8b82498..f15e767 100644 (file)
@@ -544,8 +544,7 @@ static bool resume_endpoint(struct audio_endpoint *ep)
        ep->samples = 0;
        ep->resync = false;
 
-       if (ep->codec->update_qos)
-               ep->codec->update_qos(ep->codec_data, QOS_POLICY_DEFAULT);
+       ep->codec->update_qos(ep->codec_data, QOS_POLICY_DEFAULT);
 
        return true;
 }
@@ -704,8 +703,7 @@ static bool write_data(struct a2dp_stream_out *out, const void *buffer,
                        if (diff > MAX_DELAY) {
                                warn("lag is %jums, resyncing", diff / 1000);
 
-                               if (ep->codec->update_qos)
-                                       ep->codec->update_qos(ep->codec_data,
+                               ep->codec->update_qos(ep->codec_data,
                                                        QOS_POLICY_DECREASE);
                                ep->resync = true;
                        }