- // find pattern
- QString filter = KUrl(m_view.clip_path->text()).fileName();
- QString ext = filter.section('.', -1);
- filter = filter.section('%', 0, -2);
- QString regexp = '^' + filter + "\\d+\\." + ext + '$';
- QRegExp rx(regexp);
- QStringList entries;
- foreach(const QString & path, result) {
- if (rx.exactMatch(path)) entries << path;
- }
- result = entries;
+ int offset = 0;
+ QString path = m_view.clip_path->text();
+ if (path.contains('?')) {
+ // New MLT syntax
+ offset = m_view.clip_path->text().section(':', -1).toInt();
+ path = path.section('?', 0, 0);
+ }
+ QString filter = KUrl(path).fileName();
+ QString ext = filter.section('.', -1);
+ filter = filter.section('%', 0, -2);
+ QString regexp = '^' + filter + "\\d+\\." + ext + '$';
+ QRegExp rx(regexp);
+ QStringList entries;
+ int ix;
+ foreach(const QString & path, result) {
+ if (rx.exactMatch(path)) {
+ if (offset > 0) {
+ // make sure our image is in the range we want (> begin)
+ ix = path.section(filter, 1).section('.', 0, 0).toInt();
+ if (ix < offset) continue;
+ }
+ entries << path;
+ }
+ }
+ result = entries;