summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-02-13 00:29:58 +0100
committerCarl Hetherington <cth@carlh.net>2022-02-20 00:52:25 +0100
commit1285be7c748d5b982405011ade177a95d29da238 (patch)
tree9c9610414332bc31bb7a775b4559318e9f8f5af8 /src/lib/ffmpeg_examiner.cc
parent38753d322e7bab87f98090b0724db656b89a9015 (diff)
Relax error handling when examining FFmpeg files (#2187).
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
-rw-r--r--src/lib/ffmpeg_examiner.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 5e53f0974..3c6d185f4 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -264,12 +264,9 @@ FFmpegExaminer::audio_packet (AVCodecContext* context, shared_ptr<FFmpegAudioStr
}
int r = avcodec_send_packet (context, packet);
- if (r < 0 && !(r == AVERROR_EOF && !packet) && r != AVERROR(EAGAIN)) {
- /* We could cope with AVERROR(EAGAIN) and re-send the packet but I think it should never happen.
- * AVERROR_EOF can happen during flush if we've already sent a flush packet.
- * EAGAIN means we need to do avcodec_receive_frame, so just carry on and do that.
- */
- throw DecodeError (N_("avcodec_send_packet"), N_("FFmpegExaminer::audio_packet"), r);
+ if (r < 0) {
+ LOG_WARNING("avcodec_send_packet returned %1 for an audio packet", r);
+ return;
}
auto frame = audio_frame (stream);