Feature #1870

MPL subtitles support

Added by Leonid Protasov about 7 years ago. Updated about 7 years ago.

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

100%

Category:Subtitles
Target version:4.6

Description

MPL is just the early simplified version of SUB format. Timestamps use [] brackets instead of {} in SUB format.
Example: http://dl.opensubtitles.org/en/download/filead/src-api/vrf-18a853e962/1953220719.gz

To add MPL support to ST just change in ext_subtitles.c following function:

static int
get_sub_timestamp(const char *buf, int *start, int *stop)
{
  const char *b = buf;
  if((*b != '{') && (*b != '['))
    return -1;
  *start = strtol(b + 1, (char **)&b, 10);
  if(((b[0] != '}') || (b[1] != '{')) && ((b[0] != ']') || (b[1] != '[')))
    return -1;
  *stop = strtol(b + 2, (char **)&b, 10);
  if((b[0] != '}') && (b[0] != ']'))
    return -1;

  return b + 1 - buf;
}

Associated revisions

Revision 8b3cca40
Added by Andreas Smas about 7 years ago

Add support for MPL subtitle format

Fixes #1870

Revision b576441b
Added by Andreas Smas about 7 years ago

Add support for MPL subtitle format

Fixes #1870

Change included in version 4.5.12

History

#1 Updated by Andreas Smas about 7 years ago

  • Target version deleted (4.4)

#2 Updated by Leonid Protasov about 7 years ago

Timestamps in mpl are not frames but Sequential Time:
https://wiki.videolan.org/Subtitles#Subtitles_support_in_VLC

Also "/" at the beginning of the string is like "y:i" in SUB.

#3 Updated by Leonid Protasov about 7 years ago

  • Target version set to 4.6

#4 Updated by Leonid Protasov about 7 years ago

  • Priority changed from High to Normal

#5 Updated by Andreas Smas about 7 years ago

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

Applied in changeset git|commit:8b3cca400900fabe7aa4aff00463701a689ae4eb.

Also available in: Atom PDF