mirror of https://github.com/mpv-player/mpv
Select audio stream in mplayer and mencoder, overriding demuxer decision.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26122 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
377d745ae9
commit
22465e56cc
|
@ -599,6 +599,8 @@ if(stream->type==STREAMTYPE_DVDNAV){
|
|||
mp_msg(MSGT_DEMUXER, MSGL_FATAL, MSGTR_CannotOpenDemuxer);
|
||||
mencoder_exit(1,NULL);
|
||||
}
|
||||
|
||||
select_audio(demuxer, audio_id, audio_lang);
|
||||
|
||||
if (dvdsub_id < 0 && dvdsub_lang)
|
||||
dvdsub_id = demuxer_sub_track_by_lang(demuxer, dvdsub_lang);
|
||||
|
|
13
mpcommon.c
13
mpcommon.c
|
@ -190,3 +190,16 @@ void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset)
|
|||
tvh->functions->control(tvh->priv,TV_VBI_CONTROL_MARK_UNCHANGED,NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang)
|
||||
{
|
||||
if (audio_id == -1 && audio_lang)
|
||||
audio_id = demuxer_audio_track_by_lang(demuxer, audio_lang);
|
||||
if (audio_id != -1) // -1 (automatic) is the default behaviour of demuxers
|
||||
demuxer_switch_audio(demuxer, audio_id);
|
||||
if (audio_id == -2) { // some demuxers don't yet know how to switch to no sound
|
||||
demuxer->audio->id = -2;
|
||||
demuxer->audio->sh = NULL;
|
||||
}
|
||||
return demuxer->audio->id;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@ extern struct ass_track_s *ass_track;
|
|||
extern subtitle *vo_sub_last;
|
||||
void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset);
|
||||
void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset);
|
||||
int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang);
|
||||
|
||||
#endif /* MPLAYER_MPCOMMON_H */
|
||||
|
|
Loading…
Reference in New Issue