Commit Graph
85 Commits
Author SHA1 Message Date
Scott Percival 94e482145b VIDEO: Fix infinite loop when loading greyscale QT videos 2022-10-06 00:05:17 +02:00
sluicebox 69662ee9a4 VIDEO: Fix QuickTime regression with mediaTime and dithering
Fixes an error when playing a QuickTime video that has a mediaTime set
on its first edit. This was caused by mediaTime changes in:
ef184a6cef

Those changes buffered frames during initialization so that the keyframe
and other frames don't play instead of the intended start frame that
mediaTime specifies. My mistake was that decoding isn't allowed during
VideoDecoder::loadStream(); VideoDecoder::setDitheringPalette() requires
that no frames have been decoded yet, and at least Director and Mohawk
call that.

Now the initial mediaTime buffering is delayed until the first decode.

Fixes bug #13479 where certain Myst videos error.
Fixes the opening movie in the Director game Chop Suey.
2022-08-04 15:49:30 -04:00
D G Turner 3192daf0a7 VIDEO: Fix Signed vs. Unsigned Warnings in MTROPOLIS changes to QT Decoder 2022-06-16 21:58:09 +02:00
elasota a4c8fb1b85 MTROPOLIS: Add support for QuickTime ranges, fix Obsidian Bureau light carousel triggering without interaction. 2022-06-16 21:58:09 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
sluicebox d5f6d2543f VIDEO: Fix QuickTime decoding when color depth is 32
Color depths greater than 32 have grayscale bit 0x20 set, but the
decoder incorrectly treats 32 as grayscale and and clears the bit,
leaving the color depth as zero and causing codecs to fail.

Confirmed correct behavior in the ffmpeg code that the decoder was
based off. The decoder was introduced with the Mohawk engine in
2009,so presumably no Mohawk movies had color depth 32.

Fixes videos in the Director game Virtual Cocktail Bar
2021-11-13 04:09:26 -06:00
sluicebox dcd537337b VIDEO: Fix QuickTime decoding of edits with mediaTime
QuickTimeDecoder has a bug which causes the mediaTime offset to be
ignored when a track begins with an empty edit and is followed by an
edit with a non-zero mediaTime. This causes the KQ6 Mac opening movie
to start several tracks at unintended frames (they're never supposed to
be displayed) and the intended frames at the end of the edit to never
be displayed. (Bug #11085)
2021-11-12 18:47:22 +02:00
sluicebox 6e3403464b VIDEO: Limit QuickTime workaround to Riven
QuickTimeDecoder has a workaround for a video in a Spanish version of
Riven, but this workaround breaks valid QuickTime videos such as the
KQ6 Macintosh opening movie. (Bug #11085)

Until the original Riven video bug can be debugged to improve the
workaround, it is now disabled unless an engine enables it.

Workaround added in: b8abe40085
2021-11-12 18:47:22 +02:00
sluicebox 946bb818ea VIDEO: QuickTime comments, mild cleanup 2021-11-12 18:47:22 +02:00
Orgad Shaneh 7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
djsrv 2eca1126c5 VIDEO: Use Path type in VideoDecoder functions 2021-08-07 10:44:37 +02:00
djsrv d0bca26bf7 VIDEO: Add default QuickTime palettes
This is used in L-Zone.
2021-06-29 22:48:14 -04:00
Bastien Bouclet f72f71a6cc VIDEO: Keep track of the duration of ignored edits
Fixes inconsistent videos playing in Caldoria in the DVD version of JMP
Pegasus Prime.
2019-02-02 13:30:44 +01:00
Bastien Bouclet b8abe40085 VIDEO: QT: Make sure all the edits are in the media bounds
In the Spanish version of Riven, the last edit of the video ogk.mov
ends one frame after the end of the media causing the playback to fail
without this check.

Fixes Trac#10633.
2018-07-21 08:02:40 +02:00
Bastien Bouclet c76c052259 VIDEO: Fix seeking the the last frame of QT videos while playing backwards
Fixes Trac#10590.
2018-06-29 07:20:28 +02:00
Bastien Bouclet 8547c89b86 VIDEO: Change QT edit list to a Common::Array
And fix an out of bounds acces when seeking to the end of a video.
Skipping samples is needed even when seeking through silent edits
because a silent stream is queued for those.

Fixes #10219.
2017-09-21 13:06:18 +02:00
Bastien Bouclet ec49730711 VIDEO: Allow setting the mixer sound type used to play audio tracks 2017-07-27 06:40:07 +02:00
Bastien Bouclet 6d8eebbf7b VIDEO: Stay on the first edit when playing QT videos backwards
We don't support playing videos with multiple edits backwards. Taking the code
path to move to the next edit when playing backwards sets the current edit index
to an invalid value with the video still trying to play. Which results in out of
bounds reads, and ultimately a crash.

This fixes multiple crashes in Myst. Using the key without the chest on
Stoneship, resetting the clock tower puzzle, and using the switch in the trees
in Channelwood.

This was a regression introduced in a59f5db505.
2016-02-13 17:54:07 +01:00
Matthew Hoops 49885d686e VIDEO: Implement fallback dithering for QuickTime videos
Used for any codec without direct dithering support
2015-04-12 20:12:38 -04:00
Matthew Hoops b170b08822 VIDEO: Add support for dithering in QuickTime videos 2015-04-11 14:37:04 -04:00
Matthew Hoops cb25b7b5ee VIDEO: Make the QuickTime code error out again if the frame data can't be found
The case shouldn't actually ever happen; the off-by-one bug when seeking to the last frame of the media (in an edit) caused this originally
2015-01-20 20:10:59 -05:00
Matthew Hoops 7d1ee5563a VIDEO: Remove the "-1" edit hack
With the previous commits' fixes, it's no longer needed
2015-01-20 20:10:59 -05:00
Matthew Hoops 1a0f104acf VIDEO: Fix potential off-by-one frame time after seek
If seeking to the final frame of an edit, _nextFrameStartTime wouldn't be adjust properly and would wrongly say that it's at the end of the edit. This never affected anything because of the edit "-1" hack.
2015-01-20 20:10:59 -05:00
Matthew Hoops 8e2a438dd9 VIDEO: Fix edit frame calculation
An edit that seeks to the last frame of the media would not show
2015-01-20 20:10:59 -05:00
Matthew Hoops aaf4d38a56 VIDEO: Round the edit time offset instead of truncating it
Allows for the KQ6 Mac intro to play without the edit "-1" hack
2015-01-20 20:10:58 -05:00
Matthew Hoops a59f5db505 VIDEO: Fix timing with frames going past the edit boundary 2015-01-20 20:10:58 -05:00
Matthew Hoops acec700c11 IMAGE: Share the same pool of codecs between PICT and QuickTime 2014-02-28 00:32:06 -05:00
Matthew Hoops 08ea14a8d0 IMAGE: Make Codec take a stream reference; change function name to decodeFrame 2014-02-28 00:27:37 -05:00
Matthew Hoops c432b96cf6 IMAGE: Merge the JPEG codec into the ImageDecoder 2014-02-28 00:27:36 -05:00
Matthew Hoops b568ac73b9 IMAGE: Move video codecs to image/ 2014-02-28 00:27:36 -05:00
Johannes Schickel 8f3a923686 VIDEO: Make GPL headers consistent in themselves. 2014-02-18 02:39:39 +01:00
Matthew Hoops b23f764028 VIDEO: Rename the Motion JPEG decoder to JPEG to better reflect its purpose
This JPEG is separate from the modified JPEG format used in MJPEG
2014-01-17 19:17:29 -05:00
Matthew Hoops ef098e2898 VIDEO: Fix potential memory leak when buffering a QuickTime frame 2013-04-15 18:33:54 -04:00
Matthew Hoops ce1268b73d VIDEO: Allow for QuickTime movies to be played backwards
Still doesn't handle videos with multiple edits
2012-12-15 20:43:43 -05:00
clone2727 91317c3630 Merge pull request #293 from clone2727/qtmidi
Add support for QuickTime Music playback
2012-12-13 15:49:40 -08:00
Matthew Hoops 64389c0643 VIDEO: Fix edits with scales not divisible by the media scale
QuickTime docs aren't completely clear on this, but from samples it's clear that the value needs to be rounded
2012-10-12 13:37:32 -04:00
Matthew Hoops 075d0b4812 VIDEO: Fix choosing of the correct edit when seeking
Previously it could be off-by-one
2012-10-12 13:36:23 -04:00
Matthew Hoops 4a458236f6 COMMON: Make QuickTimeParser::readSampleDesc take the desc size 2012-09-09 13:47:40 -04:00
Bertrand Augereau 341c3abad5 VIDEO: Constified a temporary 2012-09-01 18:57:29 +02:00
Matthew Hoops 18823198ad VIDEO: Merge AdvancedVideoDecoder into VideoDecoder 2012-08-16 14:00:14 -04:00
Matthew Hoops 991710d0a1 VIDEO: Adapt QuickTimeDecoder to the AdvancedVideoDecoder API 2012-07-27 11:32:51 -04:00
Matthew Hoops 10f7e805c2 VIDEO: Add volume/balance control to VideoDecoder 2012-05-28 14:00:16 -04:00
Matthew Hoops 0aacf4c4c0 VIDEO: Make seekToTime() take a const Timestamp reference 2012-05-12 22:05:32 -04:00
Matthew Hoops 9e330174c8 VIDEO: Change getElapsedTime() into getTime()
This name change accompanies a slight meaning change; now it means the current time position from the beginning of the video and not from starting the video.
2012-05-12 21:28:13 -04:00
Matthew Hoops 19d634389d VIDEO: Create the QuickTime scaled surface after reading in a frame
Fixes issues where the codec hasn't been initialized
2012-04-15 16:00:01 -04:00
Matthew Hoops 744528cb18 VIDEO: Clean up the SVQ1 code 2012-04-08 03:29:56 +01:00
D G Turner e16270605a VIDEO: Hookup SVQ1 codec to build system and QT Decoder. 2012-04-08 03:29:04 +01:00
Matthew Hoops be8c557645 AUDIO: Add support for multiple QuickTime audio tracks
This also cleans up the QuickTime audio code to make it a bit more manageable too
2012-03-19 12:04:46 -04:00
Willem Jan Palenstijn 342fd8cc28 VIDEO: Remove unused variable 2012-02-11 11:36:26 +01:00
Matthew Hoops b367772b5f VIDEO: Add support for QuickTime video track edit lists 2011-12-12 12:28:48 -05:00