summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-11 00:31:31 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commitcffb00d2625747e77a89a2cbed3e51ce04196aad (patch)
tree284931340464d18715099ef9ee3bf7f3d696343a /src/lib
parent7557ce631ab3e0b62e9683d03ef641e86a93a5de (diff)
Fix crash with no video.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc19
-rw-r--r--src/lib/ffmpeg_decoder.cc8
2 files changed, 18 insertions, 9 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 32c2dee8b..fdbdd4eb5 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -276,12 +276,19 @@ FFmpegContent::technical_summary () const
string filt = Filter::ffmpeg_string (_filters);
- return Content::technical_summary() + " - "
- + video->technical_summary() + " - "
- + audio->technical_summary() + " - "
- + String::compose (
- "ffmpeg: audio %1 subtitle %2 filters %3", as, ss, filt
- );
+ string s = Content::technical_summary ();
+
+ if (video) {
+ s += " - " + video->technical_summary ();
+ }
+
+ if (audio) {
+ s += " - " + audio->technical_summary ();
+ }
+
+ return s + String::compose (
+ "ffmpeg: audio %1 subtitle %2 filters %3", as, ss, filt
+ );
}
void
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 14c2e63e2..195167d4b 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -111,10 +111,12 @@ FFmpegDecoder::flush ()
/* XXX: should we reset _packet.data and size after each *_decode_* call? */
- while (decode_video_packet ()) {}
+ while (video && decode_video_packet ()) {}
- decode_audio_packet ();
- audio->flush ();
+ if (audio) {
+ decode_audio_packet ();
+ audio->flush ();
+ }
}
bool