diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-08-16 18:21:21 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-09-18 21:04:46 +0200 |
commit | 44d8ec9272ad265aae02b064a0c5f4a80db5a107 (patch) | |
tree | c7a7b311f0022c26cc783f6020bf0c50f90395ef /mplayer.c | |
parent | 435d7c97c900a53adedcca32b07bb4a9a5f890d3 (diff) | |
download | mpv-44d8ec9272ad265aae02b064a0c5f4a80db5a107.tar.bz2 mpv-44d8ec9272ad265aae02b064a0c5f4a80db5a107.tar.xz |
sd_lavc: use subtitle framework for former av_sub.c code
Change libavcodec subtitle decoding code (used for some bitmap
subtitle types) to use the same decoding framework as sd_ass. The
functionality that was previously in av_sub.c and was directly called
from mplayer.c is now in sd_lavc.c.
Conflicts:
mplayer.c
sub/av_sub.h
sub/sd_lavc.c
Merged from mplayer2. The remaining use of is_av_sub() is replaced by
a check whether a subtitle decoder is active, which should give the
same results.
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -80,7 +80,6 @@ #include "screenshot.h" #include "sub/sub.h" -#include "sub/av_sub.h" #include "cpudetect.h" #ifdef CONFIG_X11 @@ -587,8 +586,6 @@ static void uninit_subs(struct demuxer *demuxer) struct sh_sub *sh = demuxer->s_streams[i]; if (sh && sh->initialized) sub_uninit(sh); - if (sh && is_av_sub(sh->type)) - reset_avsub(sh); } } @@ -1747,7 +1744,6 @@ double playing_audio_pts(struct MPContext *mpctx) static void reset_subtitles(struct MPContext *mpctx) { struct sh_sub *sh_sub = mpctx->sh_sub; - int type = sh_sub ? sh_sub->type : '\0'; if (sh_sub) sub_reset(sh_sub, mpctx->osd); @@ -1758,8 +1754,6 @@ static void reset_subtitles(struct MPContext *mpctx) spudec_reset(vo_spudec); vo_osd_changed(OSDTYPE_SPU); } - if (sh_sub && is_av_sub(type)) - reset_avsub(sh_sub); } static void update_subtitles(struct MPContext *mpctx, double refpts_tl) @@ -1836,7 +1830,7 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) if (track->vobsub_id_plus_one || timestamp >= 0) spudec_assemble(vo_spudec, packet, len, timestamp); } - } else if (d_sub && (is_text_sub(type) || is_av_sub(type))) { + } else if (d_sub && (is_text_sub(type) || (sh_sub && sh_sub->active))) { if (d_sub->non_interleaved) ds_get_next_pts(d_sub); @@ -1852,13 +1846,6 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) } double duration = d_sub->first->duration; len = ds_get_packet_sub(d_sub, &packet); - if (is_av_sub(type)) { - int ret = decode_avsub(sh_sub, packet, len, subpts_s, duration); - if (ret < 0) - mp_msg(MSGT_SPUDEC, MSGL_WARN, "lavc failed decoding " - "subtitle\n"); - continue; - } if (type == 'm') { if (len < 2) continue; @@ -1869,6 +1856,7 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) sub_decode(sh_sub, mpctx->osd, packet, len, subpts_s, duration); continue; } + // is_text_sub() case if (subpts_s != MP_NOPTS_VALUE) { if (duration < 0) sub_clear_text(&mpctx->subs, MP_NOPTS_VALUE); |