Skip to content

Commit 5eb2088

Browse files
committed
tidy up a little bit
1 parent 352c208 commit 5eb2088

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/src/main/cpp/NativeTrack.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Java_org_akanework_gramophone_logic_utils_NativeTrack_create(
101101
auto theTrack = ::operator new(AUDIO_TRACK_SIZE);
102102
memset(theTrack, (unsigned char)0xde, AUDIO_TRACK_SIZE);
103103
auto holder = new track_holder();
104-
if (true || parcel != nullptr) { // implies SDK >= 31
104+
if (parcel != nullptr) { // implies SDK >= 31
105105
// I'm too cool to call AttributionSourceState ctor before using it.
106106
auto myParcel = ZN7android19parcelForJavaObjectEP7_JNIEnvP8_jobject(env, parcel);
107107
if (myParcel == nullptr) {
@@ -130,8 +130,7 @@ Java_org_akanework_gramophone_logic_utils_NativeTrack_doSet(
130130
JNIEnv *, jobject, jlong ptr) {
131131
auto holder = (track_holder*) ptr;
132132
auto refs = holder->callback->createWeak(holder);
133-
ALOGE("calling set on %p with ats %p", holder->track, holder->ats);
134-
fake_wp callback = { .thePtr = nullptr };
133+
fake_wp callback = { .thePtr = holder->callback, .refs = refs };
135134
fake_sp sharedMemory = { .thePtr = nullptr };
136135
auto ret = ZN7android10AudioTrack3setE19audio_stream_type_tj14audio_format_t20audio_channel_mask_tm20audio_output_flags_tRKNS_2wpINS0_19IAudioTrackCallbackEEEiRKNS_2spINS_7IMemoryEEEb15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tRKNS_7content22AttributionSourceStateEPK18audio_attributes_tbfi(
137136
holder->track,
@@ -141,7 +140,7 @@ Java_org_akanework_gramophone_logic_utils_NativeTrack_doSet(
141140
/* channelMask = */ 1,
142141
/* frameCount = */ 0 /* default */,
143142
/* flags = */ 0 /* AUDIO_OUTPUT_FLAG_NONE */,
144-
/* callback = */ callback, // TODO add back ptr/refs
143+
/* callback = */ callback,
145144
/* notificationFrames = */ 0 /* default */,
146145
/* sharedBuffer = */ sharedMemory,
147146
/* threadCanCallJava = */ true,

0 commit comments

Comments
 (0)