diff options
author | wm4 <wm4@nowhere> | 2014-07-05 16:57:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-05 17:07:15 +0200 |
commit | 338004bcfc224727d1477d303aa1521bf3ac21be (patch) | |
tree | 5066a689bb13f4c00a360d9b33a485d81eb17d72 /player/sub.c | |
parent | 4d2a4afdef24c343b98e71dddcb3382e85c09c96 (diff) | |
download | mpv-338004bcfc224727d1477d303aa1521bf3ac21be.tar.bz2 mpv-338004bcfc224727d1477d303aa1521bf3ac21be.tar.xz |
dvd, bluray, cdda: add demux_disc containing all related hacks
DVD and Bluray (and to some extent cdda) require awful hacks all over
the codebase to make them work. The main reason is that they act like
container, but are entirely implemented on the stream layer. The raw
mpeg data resulting from these streams must be "extended" with the
container-like metadata transported via STREAM_CTRLs. The result were
hacks all over demux.c and some higher-level parts.
Add a "disc" pseudo-demuxer, and move all these hacks and special-cases
to it.
Diffstat (limited to 'player/sub.c')
-rw-r--r-- | player/sub.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/player/sub.c b/player/sub.c index e46438e66e..7202eff9e5 100644 --- a/player/sub.c +++ b/player/sub.c @@ -158,46 +158,6 @@ void update_subtitles(struct MPContext *mpctx) update_subtitle(mpctx, 1); } -static void set_dvdsub_fake_extradata(struct dec_sub *dec_sub, struct stream *st, - int width, int height) -{ - if (!st) - return; - - struct stream_dvd_info_req info; - if (stream_control(st, STREAM_CTRL_GET_DVD_INFO, &info) < 0) - return; - - struct mp_csp_params csp = MP_CSP_PARAMS_DEFAULTS; - csp.int_bits_in = 8; - csp.int_bits_out = 8; - float cmatrix[3][4]; - mp_get_yuv2rgb_coeffs(&csp, cmatrix); - - if (width == 0 || height == 0) { - width = 720; - height = 480; - } - - char *s = NULL; - s = talloc_asprintf_append(s, "size: %dx%d\n", width, height); - s = talloc_asprintf_append(s, "palette: "); - for (int i = 0; i < 16; i++) { - int color = info.palette[i]; - int c[3] = {(color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff}; - mp_map_int_color(cmatrix, 8, c); - color = (c[2] << 16) | (c[1] << 8) | c[0]; - - if (i != 0) - s = talloc_asprintf_append(s, ", "); - s = talloc_asprintf_append(s, "%06x", color); - } - s = talloc_asprintf_append(s, "\n"); - - sub_set_extradata(dec_sub, s, strlen(s)); - talloc_free(s); -} - static void reinit_subdec(struct MPContext *mpctx, struct track *track, struct dec_sub *dec_sub) { @@ -210,7 +170,6 @@ static void reinit_subdec(struct MPContext *mpctx, struct track *track, int h = sh_video ? sh_video->disp_h : 0; float fps = sh_video ? sh_video->fps : 25; - set_dvdsub_fake_extradata(dec_sub, track->demuxer->stream, w, h); sub_set_video_res(dec_sub, w, h); sub_set_video_fps(dec_sub, fps); sub_set_ass_renderer(dec_sub, mpctx->ass_library, mpctx->ass_renderer); |