use crate::player::{audio, video};
use thiserror::Error;

#[derive(Debug, Error)]
#[error("player context error: {0}")]
pub enum PlayerError {
    VideoContext(#[from] video::ContextError),
    AudioContext(#[from] audio::ContextError),
    AudioOutput(#[from] audio::AudioOutputError),
    FFmpeg(#[from] ffmpeg::Error),
    #[error("the input has been consumed by the decoder and must be set again")]
    InputConsumed,
    #[error("failed to start decoder thread")]
    DecoderStart,
    #[error("audio stream not found: index {0}")]
    AudioStreamNotFound(usize),
}
