From 746c24835183f0d34f25cdad04e60c3fe60df055 Mon Sep 17 00:00:00 2001 From: lu_zero Date: Tue, 13 Nov 2007 22:57:22 +0000 Subject: [PATCH] Revert stray commit r25027 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25037 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_nemesi.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/libmpdemux/demux_nemesi.c b/libmpdemux/demux_nemesi.c index 0b19d76169..8e99e0caa4 100644 --- a/libmpdemux/demux_nemesi.c +++ b/libmpdemux/demux_nemesi.c @@ -74,13 +74,12 @@ static void link_session_and_fetch_conf(Nemesi_DemuxerStreamData * ndsd, rtp_ssrc *ssrc = NULL; rtp_frame * fr = &ndsd->first_pkt[stype]; rtp_buff trash_buff; - int must_prefetch = ((fps != NULL) || (buff != NULL)) ? 1 : 0; ndsd->session[stype] = sess; ssrc = wait_for_packets(ndsd, stype); - if ( ((ssrc) && (must_prefetch)) ) { + if ( (ssrc) && (fps != NULL) ) { if (buff == NULL) buff = &trash_buff; @@ -89,7 +88,7 @@ static void link_session_and_fetch_conf(Nemesi_DemuxerStreamData * ndsd, /* Packet prefecthing must be done anyway or we won't be able to get the metadata, but fps calculation happens only if the user didn't specify the FPS */ - if ( ((!force_fps) && (fps != NULL)) ) { + if (!force_fps) { while ( *fps <= 0 ) { //Wait more pkts to calculate FPS and try again sched_yield(); @@ -156,14 +155,11 @@ demuxer_t* demux_open_rtp(demuxer_t* demuxer) for (; media; media=media->next) { sdp_medium_info * info = media->medium_info; rtp_session * sess = media->rtp_sess; - rtp_buff buff; int media_format = atoi(info->fmts); rtp_pt * ptinfo = rtp_get_pt_info(sess, media_format); char const * format_name = ptinfo ? ptinfo->name : NULL; - memset(&buff, 0, sizeof(rtp_buff)); - if (sess->parsers[media_format] == NULL) { mp_msg(MSGT_DEMUX, MSGL_ERR, "libNemesi unsupported media format: %s\n", @@ -179,21 +175,13 @@ demuxer_t* demux_open_rtp(demuxer_t* demuxer) if (ptinfo->type == AU) { if (ndsd->session[NEMESI_SESSION_AUDIO] == NULL) { sh_audio_t* sh_audio = new_sh_audio(demuxer,0); - WAVEFORMATEX* wf; + WAVEFORMATEX* wf = calloc(1,sizeof(WAVEFORMATEX)); demux_stream_t* d_audio = demuxer->audio; mp_msg(MSGT_DEMUX, MSGL_INFO, "Detected as AUDIO stream...\n"); link_session_and_fetch_conf(ndsd, NEMESI_SESSION_AUDIO, - sess, &buff, NULL); - - if (buff.len) { - wf = calloc(1,sizeof(WAVEFORMATEX)+buff.len); - wf->cbSize = buff.len; - memcpy(wf+1, buff.data, buff.len); - } else { - wf = calloc(1,sizeof(WAVEFORMATEX)); - } + sess, NULL, NULL); sh_audio->wf = wf; d_audio->sh = sh_audio; @@ -217,11 +205,13 @@ demuxer_t* demux_open_rtp(demuxer_t* demuxer) " ignoring...\n"); } } else if (ptinfo->type == VI) { - if (ndsd->session[NEMESI_SESSION_VIDEO] == NULL) { + if (ndsd->session[NEMESI_SESSION_AUDIO] == NULL) { sh_video_t* sh_video; BITMAPINFOHEADER* bih; demux_stream_t* d_video; int fps = 0; + rtp_buff buff; + memset(&buff, 0, sizeof(rtp_buff)); mp_msg(MSGT_DEMUX, MSGL_INFO, "Detected as VIDEO stream...\n"); @@ -334,11 +324,6 @@ int demux_rtp_fill_buffer(demuxer_t* demuxer, demux_stream_t* ds) stream_add_packet(ndsd, stype, ds, &fr); else { stype = INVERT_STYPE(stype); - - //Must check if we actually have a stream of the other type - if (!ndsd->session[stype]) - return 1; - ds = STYPE_TO_DS(demuxer, stype); ssrc = wait_for_packets(ndsd, stype);