[MPlayer-dev-eng] [PATCH] Support for DVB subtitles
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Feb 28 10:18:50 CET 2009
On Sat, Feb 28, 2009 at 12:41:53AM +0100, Nicolas George wrote:
> @@ -1491,6 +1493,8 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
> sh_sub_t *sh = d_sub->sh;
> if (sh->type == 'v')
> init_vo_spudec();
> + else if(sh->type == 'b')
> + dvbsub_init(sh->extradata, sh->extradata_len);
Surrouinding code uses tabs.
> +struct dvbsus_frame {
what is "sus" supposed to stand for?
> + if (extradata_size == sizeof(int))
> + decoder->sub_id = *(int *)extradata;
I doubt this is correct, extradata should be architecture-independent,
i.e. be a fixed size, not sizeof(int) and always litte- or big-endian,
not native-endian.
> +void dvbsub_process_packet(uint8_t *packet, int size, double pts)
> +{
> + int r, got_sub = 0;
> + AVSubtitle sub;
> +
> + if (!decoder)
> + return;
Can this validly happen? If not, either remove it or make it an assert.
> + if (sub_visibility && (pts != MP_NOPTS_VALUE)) {
> + if (dvbsub_frames)
> + images = dvbsub_render_frame(pts);
> + else if (vf->priv->ass_priv && ass_track)
> + images = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, NULL);
> + }
I guess there is no way to display both currently?
> --- a/mp_msg.h
> +++ b/mp_msg.h
> @@ -104,6 +104,8 @@ extern int verbose;
>
> #define MSGT_STATUSLINE 45 // playback/encoding status line
>
> +# define MSGT_DVBSUB 46 // DVB subtitles
> +
extra space
> @@ -66,7 +67,6 @@ if (HAVE_CMOV)
> #endif /* ARCH_X86 */
> }
>
> -
> void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset)
cosmetic
More information about the MPlayer-dev-eng
mailing list