mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 06:03:45 +01:00
demux_asf, asfheader.c: cleanup
Move setup of sh_audio->format to a more appropriate place (in asfheader.c). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32684 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless assignments that are already handled in new_sh_audio. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32685 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove useless assignment already done in new_sh_video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32686 b3059339-0415-0410-9bf9-f77b7e298cf2 Use FFMAX for slightly better readability. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32687 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9a7ed638a6
commit
de8ec24998
@ -344,9 +344,10 @@ static int asf_init_audio_stream(demuxer_t *demuxer,struct asf_priv* asf, sh_aud
|
||||
uint8_t *buffer = *buf;
|
||||
int pos = *ppos;
|
||||
|
||||
sh_audio->wf=calloc((streamh->type_size<sizeof(*sh_audio->wf))?sizeof(*sh_audio->wf):streamh->type_size,1);
|
||||
sh_audio->wf=calloc(FFMAX(streamh->type_size, sizeof(*sh_audio->wf)), 1);
|
||||
memcpy(sh_audio->wf,buffer,streamh->type_size);
|
||||
le2me_WAVEFORMATEX(sh_audio->wf);
|
||||
sh_audio->format=sh_audio->wf->wFormatTag;
|
||||
if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V);
|
||||
if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){
|
||||
buffer = &hdr[pos];
|
||||
|
@ -621,7 +621,6 @@ static int demux_asf_control(demuxer_t *demuxer,int cmd, void *arg){
|
||||
static demuxer_t* demux_open_asf(demuxer_t* demuxer)
|
||||
{
|
||||
struct asf_priv* asf = demuxer->priv;
|
||||
sh_audio_t *sh_audio=NULL;
|
||||
sh_video_t *sh_video=NULL;
|
||||
|
||||
//---- ASF header:
|
||||
@ -640,7 +639,7 @@ static demuxer_t* demux_open_asf(demuxer_t* demuxer)
|
||||
demuxer->video->sh=NULL;
|
||||
//printf("ASF: missing video stream!? contact the author, it may be a bug :(\n");
|
||||
} else {
|
||||
sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
|
||||
sh_video=demuxer->video->sh;
|
||||
sh_video->fps=1000.0f; sh_video->frametime=0.001f;
|
||||
|
||||
if (asf->asf_is_dvr_ms) {
|
||||
@ -656,9 +655,6 @@ static demuxer_t* demux_open_asf(demuxer_t* demuxer)
|
||||
mp_msg(MSGT_DEMUXER, MSGL_INFO, "ASF: %s",
|
||||
mp_gtext("No audio stream found -> no sound.\n"));
|
||||
demuxer->audio->sh=NULL;
|
||||
} else {
|
||||
sh_audio=demuxer->audio->sh;sh_audio->ds=demuxer->audio;
|
||||
sh_audio->format=sh_audio->wf->wFormatTag;
|
||||
}
|
||||
}
|
||||
if(!demuxer->stream->seek)
|
||||
|
Loading…
Reference in New Issue
Block a user