diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-12-11 15:43:24 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-16 06:22:18 +0200 |
commit | de8ec24998b7cf3e8a9842db0c99af92c8a6475d (patch) | |
tree | 9fe03e52f2f0deed47458792b23266b70d57b18c /libmpdemux | |
parent | 9a7ed638a6af769152477072f3799efab7ccc47f (diff) | |
download | mpv-de8ec24998b7cf3e8a9842db0c99af92c8a6475d.tar.bz2 mpv-de8ec24998b7cf3e8a9842db0c99af92c8a6475d.tar.xz |
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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/asfheader.c | 3 | ||||
-rw-r--r-- | libmpdemux/demux_asf.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/libmpdemux/asfheader.c b/libmpdemux/asfheader.c index 1db6eef1ac..7a2285e2a1 100644 --- a/libmpdemux/asfheader.c +++ b/libmpdemux/asfheader.c @@ -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]; diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c index dd6829612f..a1e89ec9d1 100644 --- a/libmpdemux/demux_asf.c +++ b/libmpdemux/demux_asf.c @@ -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) |