mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 21:03:22 +01:00
Fix non-default video stream from ffprobe result (#2752)
* Fix non-default video stream from ffprobe result
This commit is contained in:
parent
6f7cc11b86
commit
b8262f5641
2 changed files with 14 additions and 3 deletions
|
|
@ -197,11 +197,21 @@ func (v *VideoFile) getVideoStream() *FFProbeStream {
|
|||
}
|
||||
|
||||
func (v *VideoFile) getStreamIndex(fileType string, probeJSON FFProbeJSON) int {
|
||||
ret := -1
|
||||
for i, stream := range probeJSON.Streams {
|
||||
if stream.CodecType == fileType {
|
||||
return i
|
||||
// skip cover art/thumbnails
|
||||
if stream.CodecType == fileType && stream.Disposition.AttachedPic == 0 {
|
||||
// prefer default stream
|
||||
if stream.Disposition.Default == 1 {
|
||||
return i
|
||||
}
|
||||
|
||||
// backwards compatible behaviour - fallback to first matching stream
|
||||
if ret == -1 {
|
||||
ret = i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
### 🐛 Bug fixes
|
||||
* Fix incorrect scene metadata being set when video has cover art. ([#2752](https://github.com/stashapp/stash/pull/2752))
|
||||
* Fix incorrect image being displayed when first previewing image. ([#2754](https://github.com/stashapp/stash/pull/2754))
|
||||
|
|
|
|||
Loading…
Reference in a new issue