From 74c11f0c841d0b81a6ea759c7eb131d2c2e02ec3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 16 Dec 2015 23:54:25 +0100 Subject: sub: detect charset in demuxer Slightly simpler, and removes the need to pre-read all subtitle packets. This still does the subtitle charset conversion on the packet level (instead converting when parsing the file), so in theory this still could provide a way to change the charset at runtime. But maybe even this should be removed, as FFmpeg is somewhat likely to get its own charset detection and conversion mechanism in the future. (Would have to keep the subtitle file in memory to allow changing the charset on the fly, I guess.) --- demux/stheader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demux/stheader.h') diff --git a/demux/stheader.h b/demux/stheader.h index a615867685..7a11832c24 100644 --- a/demux/stheader.h +++ b/demux/stheader.h @@ -93,7 +93,7 @@ typedef struct sh_video { typedef struct sh_sub { double frame_based; // timestamps are frame-based (and this is the // fallback framerate used for timestamps) - bool is_utf8; // if false, subtitle packet charset is unknown + char *charset; // assumed 8 bit subtitle charset (can be NULL) struct dec_sub *dec_sub; // decoder context } sh_sub_t; -- cgit v1.2.3