dvenc: dont fail hard if the timecode is invalid
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 5 Feb 2013 21:57:35 +0000 (22:57 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 5 Feb 2013 23:17:23 +0000 (00:17 +0100)
Instead just dont store the timecode
Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0eacbc760c8b27c2064cea5395e32971853c73c)

libavformat/dvenc.c

index 604f4ce..faeb8fd 100644 (file)
@@ -376,8 +376,8 @@ static int dv_write_header(AVFormatContext *s)
                 break;
         }
     }
-    if (tcr)
-        return av_timecode_init_from_string(&dvc->tc, rate, tcr->value, s);
+    if (tcr && av_timecode_init_from_string(&dvc->tc, rate, tcr->value, s) >= 0)
+        return 0;
     return av_timecode_init(&dvc->tc, rate, 0, 0, s);
 }