Feature #1885

Add ability to use non standard/broken SRT files (file starts from 0xD 0xA instead of an int)

Added by Ema Nymton about 7 years ago. Updated about 7 years ago.

Status:FixedStart date:01/26/2014
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:Subtitles
Target version:4.6

Description

Whenever I try to load the attached subtitle, I get the following error:

00:12:49.697: Video [DEBUG]:Selecting subtitle track smb://192.168.1.103/Downloads/End of Watch (2012) [1080p]//End.of.Watch.2012.1080p.BluRay.x264.YIFY.srt
00:12:49.698: Subtitles [DEBUG]:Trying to load smb://192.168.1.103/Downloads/End of Watch (2012) [1080p]//End.of.Watch.2012.1080p.BluRay.x264.YIFY.srt
00:12:49.780: Subtitles [ERROR]:Unable to load smb://192.168.1.103/Downloads/End of Watch (2012) [1080p]//End.of.Watch.2012.1080p.BluRay.x264.YIFY.srt -- Unknown format (1073741824 bytes), dump of first 64 bytes follows
00:12:49.781: Subtitles [DEBUG]:0x000000: 0d 0a 32 0d 0a 30 30 3a  30 30 3a 33 37 2c 30 38    ..2..00:00:37,08
00:12:49.781: Subtitles [DEBUG]:0x000010: 33 20 2d 2d 3e 20 30 30  3a 30 30 3a 33 38 2c 37    3 --> 00:00:38,7
00:12:49.781: Subtitles [DEBUG]:0x000020: 35 30 0d 0a 3c 69 3e 49  27 6d 20 74 68 65 20 70    50..<i>I'm the p
00:12:49.782: Subtitles [DEBUG]:0x000030: 6f 6c 69 63 65 2e 3c 2f  69 3e 0d 0a 0d 0a 33 0d    olice.</i>....3.

End.of.Watch.2012.1080p.BluRay.x264.YIFY.srt (145 KB) Ema Nymton, 01/26/2014 03:13 PM

Associated revisions

Revision f806f698
Added by Andreas Smas about 7 years ago

SRT: Skip over any initial control characters

Fixes #1885

Change included in version 4.5.2

History

#1 Updated by Leonid Protasov about 7 years ago

Reproducible on 4.3.748 on all platforms. SRT file misses "1" record and starts from "2". That could be a problem...

#2 Updated by Leonid Protasov about 7 years ago

  • Subject changed from Subtitles: Unknown format to ST can't decode SRT if file starts from "2" record

#3 Updated by Leonid Protasov about 7 years ago

First line in the file is 0xD 0xA. While ST wants int number. That's why that happens.

#4 Updated by Leonid Protasov about 7 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from ST can't decode SRT if file starts from "2" record to Add ability to use non standard/broken SRT files (file starts from 0xD 0xA instead if int number)

In fact that violates SRT standard (http://en.wikipedia.org/wiki/SubRip) as it should begin from "1". But ST could handle that...

#5 Updated by Leonid Protasov about 7 years ago

  • Subject changed from Add ability to use non standard/broken SRT files (file starts from 0xD 0xA instead if int number) to Add ability to use non standard/broken SRT files (file starts from 0xD 0xA instead of an int)

#6 Updated by Andreas Smas about 7 years ago

  • Target version set to 4.6

#7 Updated by Andreas Smas about 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset git|commit:f806f6982ea8da75ac13aa5b1e5f2894a0f0bd80.

Also available in: Atom PDF