Captive has many meanings, some having to do with 'the law' and some not.
A "captive" audience is one that has no choice but to listen or attend, or the consequences of not listening or attending are severe. Students in a classroom are typically "captive" audiences - and that is not necessarily bad.
A "captive" part of a machine is one that is enclosed or attached in such a way as it cannot come loose or be removed easily. This can also apply to assemblies.
"Captivating" is typically a positive description of a person, display, or event that entirely engages an audience.
Being held "Captive" may be good or bad depending on circumstances. Prisoners-of-war are Captives on the battlefield. Only prisoners when actually imprisoned. In any case, their captivity is lawful under the rules of war.
So, context drives meaning, not purely the definition.