Be more gracious when we fail to parse some subtitle types.
authorCarl Hetherington <cth@carlh.net>
Wed, 5 Dec 2012 20:57:17 +0000 (20:57 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 5 Dec 2012 20:57:17 +0000 (20:57 +0000)
src/lib/ffmpeg_decoder.cc

index 4a6e236c3747c2326171bb68a60a4e05ba6a2ca9..075420b7ca91f5c5537959ba9d9c2ac18eefeed3 100644 (file)
@@ -366,7 +366,12 @@ FFmpegDecoder::pass ()
                           indicate that the previous subtitle should stop.
                        */
                        if (sub.num_rects > 0) {
-                               emit_subtitle (shared_ptr<TimedSubtitle> (new TimedSubtitle (sub, _first_video.get())));
+                               shared_ptr<TimedSubtitle> ts;
+                               try {
+                                       emit_subtitle (shared_ptr<TimedSubtitle> (new TimedSubtitle (sub, _first_video.get())));
+                               } catch (...) {
+                                       /* some problem with the subtitle; we probably didn't understand it */
+                               }
                        } else {
                                emit_subtitle (shared_ptr<TimedSubtitle> ());
                        }