diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-11 00:31:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | cffb00d2625747e77a89a2cbed3e51ce04196aad (patch) | |
| tree | 284931340464d18715099ef9ee3bf7f3d696343a /src/lib | |
| parent | 7557ce631ab3e0b62e9683d03ef641e86a93a5de (diff) | |
Fix crash with no video.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 19 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 8 |
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 |
