1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
    #[error("Failed to initialize format context")]
    InitializeFormatContext,
    #[error("Could not find stream in file")]
    FindStreamInfo,
    #[error("Could not find any audio stream")]
    NoAudioStream,
    #[error("Null codec pointer")]
    NullCodec,
    #[error("Null codec context pointer")]
    NullCodecContext,
    #[error("Copying params to codec context")]
    CodecParamsToContext,
    #[error("Failed to initialize decoder")]
    InitializeDecoder,
    #[error("Null frame pointer")]
    NullFrame,
    #[error("Error reading frame: {0}")]
    ReadFrame(i32),
    #[error("Error sending packet: {0}")]
    SendPacket(i32),
    #[error("Error draining decoder: {0}")]
    DrainDecoder(i32),
    #[error("Error receiving frame: {0}")]
    ReceiveFrame(i32),
    #[error("Failed to initialize swr context")]
    InitializeSwr,
}