summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-12 00:27:16 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-12 00:27:16 +0000
commit81a93ab80d04a0d01783266139cac982eb342421 (patch)
treea5a2c7976a20137b1a2b1ec3860449fced73725b /src
parenta990b287abee2fcfb7fc12d813265afa9d945646 (diff)
Don't throw an exception if we can't find bits_per_pixel, as it's not the end of the world.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg_examiner.cc4
-rw-r--r--src/lib/ffmpeg_examiner.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 88b76d04e..697bfe3ae 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -260,11 +260,11 @@ FFmpegExaminer::stream_name (AVStream* s) const
return n;
}
-int
+optional<int>
FFmpegExaminer::bits_per_pixel () const
{
if (video_codec_context()->pix_fmt == -1) {
- throw DecodeError (_("Could not find pixel format for video."));
+ return optional<int>();
}
AVPixFmtDescriptor const * d = av_pix_fmt_desc_get (video_codec_context()->pix_fmt);
diff --git a/src/lib/ffmpeg_examiner.h b/src/lib/ffmpeg_examiner.h
index a511a2fc1..5cd70d979 100644
--- a/src/lib/ffmpeg_examiner.h
+++ b/src/lib/ffmpeg_examiner.h
@@ -69,7 +69,7 @@ public:
return video_codec_context()->colorspace;
}
- int bits_per_pixel () const;
+ boost::optional<int> bits_per_pixel () const;
private:
void video_packet (AVCodecContext *);