Invalidate the cached OGG header immediately when restarting the FLAC encoder to prevent clients from receiving stale data. Also improve the player source cleanup by draining the chunk receiver and adding a timeout when waiting for the emit task to finish, preventing potential hangs when the downstream pipeline is saturated.