Skip to content

Commit

Permalink
Expose the error code from FFmpegAudioReader
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Dec 28, 2016
1 parent 9a9ff3a commit ca4f4d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/audio/ffmpeg_audio_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class FFmpegAudioReader {
bool IsFinished() const { return m_finished && !m_got_frame; }

std::string GetError() const { return m_error; }
int GetErrorCode() const { return m_error_code; }

private:
inline void SetError(const char *format, int errnum = 0);
Expand All @@ -97,6 +98,7 @@ class FFmpegAudioReader {
AVFrame *m_frame = nullptr;
int m_stream_index = -1;
std::string m_error;
int m_error_code = 0;
bool m_finished = false;
bool m_opened = false;
int m_got_frame = 0;
Expand Down Expand Up @@ -363,6 +365,7 @@ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
m_error += ")";
}
}
m_error_code = errnum;
DEBUG(m_error);
}

Expand Down

0 comments on commit ca4f4d8

Please sign in to comment.