annotate subreader.h @ 8843:c70444c5b516

I have seen problems where DVD subtitles don't display at the right time and sometimes they don't appear at all. The problem stems from the fact that subtitle command packets are being applied as soon as they are read and assembled from the input stream. Sometimes, a fully assembled subtitle packet arrives at the spudec_assemble function before the previous subtitle appears onscreen and thus the viewer only sees the second subtitle. So I created a patch that queues assembled subtitle packets and applies them at the appropriate time within the heartbeat function. The reset function clears the packet queue when seeking through the video. Tomasz Farkas <tomasz_farkas@yahoo.co.uk>
author arpi
date Wed, 08 Jan 2003 18:36:36 +0000
parents 478561617705
children 7a06258271d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
616
41d6eec69b60 clean up
pontscho
parents: 509
diff changeset
1 #ifndef __MPLAYER_SUBREADER_H
41d6eec69b60 clean up
pontscho
parents: 509
diff changeset
2 #define __MPLAYER_SUBREADER_H
258
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
3
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
4 extern int sub_uses_time;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
5 extern int sub_errs;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
6 extern int sub_num; // number of subtitle structs
8361
2202c00001e3 overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
arpi
parents: 7982
diff changeset
7 extern int suboverlap_enabled;
2912
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
8
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
9 // subtitle formats
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
10 #define SUB_INVALID -1
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
11 #define SUB_MICRODVD 0
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
12 #define SUB_SUBRIP 1
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
13 #define SUB_SUBVIEWER 2
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
14 #define SUB_SAMI 3
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
15 #define SUB_VPLAYER 4
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
16 #define SUB_RT 5
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
17 #define SUB_SSA 6
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
18 #define SUB_DUNNOWHAT 7 // FIXME what format is it ?
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
19 #define SUB_MPSUB 8
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
20 #define SUB_AQTITLE 9
6012
89c87be7a248 patch by Didier <did-c-debian@ifrance.com>:
pl
parents: 4064
diff changeset
21 #define SUB_SUBVIEWER2 10
6076
eff64fb1ffea patch fixes broken detecniou of AQTitle subtiles and adds support for subtitles created by subrip 0.9 - by Jiri.Svoboda@seznam.cz
arpi
parents: 6012
diff changeset
22 #define SUB_SUBRIP09 11
7982
eac680483e6c JACOSub is another subtitling format, whose specifications are at:
arpi
parents: 7460
diff changeset
23 #define SUB_JACOSUB 12
2912
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
24
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
25 // One of the SUB_* constant above
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
26 extern int sub_format;
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
27
7215
065387d29573 increased SUB_MAX_TEXT by Piotr Krukowiecki <piotr@pingu.ii.uj.edu.pl>
alex
parents: 6792
diff changeset
28 #define SUB_MAX_TEXT 10
258
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
29
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
30 typedef struct {
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
31
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
32 int lines;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
33
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
34 unsigned long start;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
35 unsigned long end;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
36
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
37 char *text[SUB_MAX_TEXT];
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
38 } subtitle;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
39
4064
3c747168eb6e 1. subs know are readed after reading AVI header so we already know fps
atlka
parents: 3734
diff changeset
40 subtitle* sub_read_file (char *filename, float pts);
8618
a879b231b7e3 This patch adds a call to subcp_recode1(), so this subtitles too are
arpi
parents: 8451
diff changeset
41 subtitle* subcp_recode1 (subtitle *sub);
8733
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8618
diff changeset
42 void subcp_open (void); /* for demux_ogg.c */
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8618
diff changeset
43 void subcp_close (void); /* for demux_ogg.c */
4064
3c747168eb6e 1. subs know are readed after reading AVI header so we already know fps
atlka
parents: 3734
diff changeset
44 char * sub_filename(char *path, char * fname);
2050
18f4dd5d568f -Wall warnings fixed
arpi
parents: 921
diff changeset
45 void list_sub_file(subtitle* subs);
6792
0d08931fb3c3 Correct dump_srt millisecond output
kmkaplan
parents: 6208
diff changeset
46 void dump_srt(subtitle* subs, float fps);
4064
3c747168eb6e 1. subs know are readed after reading AVI header so we already know fps
atlka
parents: 3734
diff changeset
47 void dump_mpsub(subtitle* subs, float fps);
7460
fdf31bb0450f New option for mplayer: -dumpmicrodvdsub
kmkaplan
parents: 7215
diff changeset
48 void dump_microdvd(subtitle* subs, float fps);
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8365
diff changeset
49 void dump_jacosub(subtitle* subs, float fps);
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8365
diff changeset
50 void dump_sami(subtitle* subs, float fps);
3543
5a11cbf8791f some small sub bug fix
pontscho
parents: 2912
diff changeset
51 void sub_free( subtitle * subs );
4064
3c747168eb6e 1. subs know are readed after reading AVI header so we already know fps
atlka
parents: 3734
diff changeset
52 void find_sub(subtitle* subtitles,int key);
8365
423a19edc0a4 This patch makes it possible to navigate among the subtitles while
arpi
parents: 8361
diff changeset
53 void step_sub(subtitle *subtitles, float pts, int movement);
818
16ba80b47ec4 Support for vplayer subtitles
eyck
parents: 624
diff changeset
54 #endif