mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix non-default video stream from ffprobe result (#2752)
* Fix non-default video stream from ffprobe result
This commit is contained in:
@@ -197,11 +197,21 @@ func (v *VideoFile) getVideoStream() *FFProbeStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VideoFile) getStreamIndex(fileType string, probeJSON FFProbeJSON) int {
|
func (v *VideoFile) getStreamIndex(fileType string, probeJSON FFProbeJSON) int {
|
||||||
|
ret := -1
|
||||||
for i, stream := range probeJSON.Streams {
|
for i, stream := range probeJSON.Streams {
|
||||||
if stream.CodecType == fileType {
|
// skip cover art/thumbnails
|
||||||
return i
|
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
|
### 🐛 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))
|
* Fix incorrect image being displayed when first previewing image. ([#2754](https://github.com/stashapp/stash/pull/2754))
|
||||||
|
|||||||
Reference in New Issue
Block a user