Do decoding in main thread