correct the finding of nearest i-frames
the original code used >= or <= as the test, but the code actually implemented > or <. This causes an ffmpeg error when there is only 1 i-frame between the lower and upper bound.
This commit is contained in:
parent
88dcc5b470
commit
306bd7c0ce
@ -196,15 +196,16 @@
|
|||||||
(define (mythtv-get-retention-list chanid starttime cut-or-skip)
|
(define (mythtv-get-retention-list chanid starttime cut-or-skip)
|
||||||
(apply mythtv-make-concat-list (mysql-get-cut/skip-list chanid starttime cut-or-skip)))
|
(apply mythtv-make-concat-list (mysql-get-cut/skip-list chanid starttime cut-or-skip)))
|
||||||
|
|
||||||
(define (mythtv-find-nearest-i-frame-before/after idx frame-info i test i-frame)
|
(define (mythtv-find-nearest-i-frame-before/after idx frame-info test i-frame)
|
||||||
(cond ((null? frame-info) i-frame)
|
(cond ((null? frame-info) i-frame)
|
||||||
(#t
|
(#t
|
||||||
(let ((cpn (fourth (car frame-info))))
|
(let* ((i-frame (car frame-info))
|
||||||
(if (test cpn idx) i-frame (mythtv-find-nearest-i-frame-before/after idx (cdr frame-info) cpn test(car frame-info)))))))
|
(cpn (fourth i-frame)))
|
||||||
(define (mythtv-find-nearest-i-frame-before idx frame-info i)
|
(if (test cpn idx) i-frame (mythtv-find-nearest-i-frame-before/after idx (cdr frame-info) test i-frame))))))
|
||||||
(mythtv-find-nearest-i-frame-before/after idx frame-info i >= '()))
|
(define (mythtv-find-nearest-i-frame-before idx frame-info)
|
||||||
(define (mythtv-find-nearest-i-frame-after idx frame-info i)
|
(mythtv-find-nearest-i-frame-before/after idx frame-info >= (first frame-info)))
|
||||||
(mythtv-find-nearest-i-frame-before/after idx (reverse frame-info) i <= '()))
|
(define (mythtv-find-nearest-i-frame-after idx frame-info)
|
||||||
|
(mythtv-find-nearest-i-frame-before/after idx (reverse frame-info) <= (last frame-info)))
|
||||||
|
|
||||||
(define-immutable-record-type recording
|
(define-immutable-record-type recording
|
||||||
(make-recording chanid starttime recorded-table streams-info i-frame-info retain-list)
|
(make-recording chanid starttime recorded-table streams-info i-frame-info retain-list)
|
||||||
@ -303,7 +304,7 @@
|
|||||||
(#t
|
(#t
|
||||||
(m-c-i-f-i-t-t (cdr indices)
|
(m-c-i-f-i-t-t (cdr indices)
|
||||||
(append times
|
(append times
|
||||||
(list (cons (car (mythtv-find-nearest-i-frame-after (caar indices) i-frame-info 0)) (car (mythtv-find-nearest-i-frame-before (cdar indices) i-frame-info 0)))))))))
|
(list (cons (car (mythtv-find-nearest-i-frame-after (caar indices) i-frame-info)) (car (mythtv-find-nearest-i-frame-before (cdar indices) i-frame-info)))))))))
|
||||||
(map normalize-times (m-c-i-f-i-t-t indices '()))))
|
(map normalize-times (m-c-i-f-i-t-t indices '()))))
|
||||||
|
|
||||||
(define (mythtv-recorded-table->metadata rec)
|
(define (mythtv-recorded-table->metadata rec)
|
||||||
@ -451,6 +452,7 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(define (ffmpeg-myth args)
|
(define (ffmpeg-myth args)
|
||||||
(display args) (newline)
|
(display args) (newline)
|
||||||
|
;;(shell-command-to-string #t "printenv") (newline)
|
||||||
(let* ((rgs (read-from-string (cdr args)))
|
(let* ((rgs (read-from-string (cdr args)))
|
||||||
(cmd (eval (car rgs) (interaction-environment)))
|
(cmd (eval (car rgs) (interaction-environment)))
|
||||||
(result
|
(result
|
||||||
|
Loading…
Reference in New Issue
Block a user