changeset 3316:842a6746532e libavformat

matroskadec: allows inserting chapters with unspecified end
author aurel
date Thu, 22 May 2008 23:04:02 +0000
parents 22ba37584545
children 841f0bc7857c
files matroskadec.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Thu May 22 22:07:09 2008 +0000
+++ b/matroskadec.c	Thu May 22 23:04:02 2008 +0000
@@ -2250,8 +2250,12 @@
                         }
                     }
 
-                    if(start != AV_NOPTS_VALUE && end != AV_NOPTS_VALUE)
-                        res = ff_new_chapter(s, start * AV_TIME_BASE / 1000000000 , end * AV_TIME_BASE / 1000000000, title ? title : "(unnamed)");
+                    if (start != AV_NOPTS_VALUE) {
+                        start = start * AV_TIME_BASE / 1000000000;
+                        if (end != AV_NOPTS_VALUE)
+                            end = end * AV_TIME_BASE / 1000000000;
+                        res = ff_new_chapter(s, start, end, title ? title : "(unnamed)");
+                    }
                     av_free(title);
                     break;