[MPlayer-dev-eng] [patch] DVD NAV work continues...
Kees Cook
mplayer at outflux.net
Mon Apr 1 21:41:29 CEST 2002
On Mon, Apr 01, 2002 at 08:38:05PM +0200, Arpi wrote:
> new file...
You got it.
> note, that mplayer core is _not_ ready for runtime aid/sid changes!
> it may work while parameters (ie. codec, number of channels, bitrate etc of
> audio, palette of subpic) don't change.
Agreed. It looks like the audio stuff at the very least is sane: for
DVDs it's the same channels, bitrate, etc. Not sure yet about subpic.
> but you change aid in stream so the next block of audio will be readed from
> different stream -> will cause ac3 decoder to cause noise or crash.
> (it won't crash, as it checks for crc and will print warning about broken
> audio packet but it is not normal)
>
> such events MUST be handled in mplayer.c layer, it can uninit and reinit
> audio decoder or spu decoder after ID change.
Hm. You're probably right. The reason I was trying it from the stream
layer was because I wasn't coming back from the stream layer until a full
block was read from libdvdnav (meaning that any events prior to that block
will get processed "late" by mplayer.c, since the event has happened (from
libdvdnav's perspective, but the stream layer has continued reading
packets, potentially missing audio/sub packets in the process).
I'll try pre-reading from libdvdnav and see if that helps.
I'm having trouble reseting the demuxer. It really doesn't like being
reset. ;) So far I have this:
#define DEMUXER_RESET { \
int oldtype=DEMUXER_TYPE_UNKNOWN; \
if (demuxer) oldtype=demuxer->type; \
current_module="free_demuxer"; \
if(demuxer) free_demuxer(demuxer); \
demuxer=NULL; \
d_audio=NULL; \
d_video=NULL; \
d_dvdsub=NULL; \
if (inited_flags&INITED_SPUDEC){ \
inited_flags&=~INITED_SPUDEC; \
current_module="uninit_spudec"; \
spudec_free(vo_spudec); \
vo_spudec=NULL; \
} \
\
current_module="demux_open"; \
demuxer=demux_open(stream,oldtype,audio_id,video_id,dvdsub_id); \
if(!demuxer) goto goto_next_file; \
\
d_audio=demuxer->audio; \
d_video=demuxer->video; \
d_dvdsub=demuxer->sub; \
if (vo_spudec==NULL) { \
current_module="spudec_init"; \
vo_spudec=spudec_new_scaled(stream->type==STREAMTYPE_DVD?((dvd_priv_t *)(stream->priv))->cur_pgc->palette: \
(stream->type==STREAMTYPE_DVDNAV?dvdnav_stream_get_palette((dvdnav_priv_t*)(stream->priv)) \
:NULL), \
sh_video->disp_w, sh_video->disp_h); \
} \
if (vo_spudec!=NULL) \
inited_flags|=INITED_SPUDEC; \
}
--
Kees Cook @outflux.net
More information about the MPlayer-dev-eng
mailing list