changeset 37105:f05b151463ca

demux_real: remove code that new_sh_* already handles. Also makes it easier to check that ->id and ->sh are always consistent.
author reimar
date Tue, 13 May 2014 21:06:39 +0000
parents 91b00a4407cd
children 1b9907dfe2f4
files libmpdemux/demux_real.c
diffstat 1 files changed, 2 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_real.c	Tue May 13 21:06:38 2014 +0000
+++ b/libmpdemux/demux_real.c	Tue May 13 21:06:39 2014 +0000
@@ -1505,14 +1505,11 @@
 		    if (priv->is_multirate && ((demuxer->audio->id == -1) ||
 		                               ((demuxer->audio->id >= 0) && priv->a_bitrate && (bitrate > priv->a_bitrate)))) {
 			    demuxer->audio->id = stream_id;
+			    demuxer->audio->sh = sh;
 			    priv->a_bitrate = bitrate;
 			    mp_msg(MSGT_DEMUX,MSGL_DBG2,"Multirate autoselected audio id %d with bitrate %d\n", stream_id, bitrate);
 		    }
 
-		    if(demuxer->audio->id==stream_id){
-			demuxer->audio->sh=sh;
-		    }
-
 		    ++a_streams;
 
 #ifdef stream_skip
@@ -1534,10 +1531,6 @@
 		    sh->wf->cbSize = 0;
 		    sh->wf->wFormatTag = sh->format = mmioFOURCC('a','d','u',0x55);
 
-		    if(demuxer->audio->id==stream_id){
-			    demuxer->audio->sh=sh;
-		    }
-
 		    ++a_streams;
 	  } else if (strstr(mimet,"x-ralf-mpeg4")) {
 		    sh_audio_t *sh = new_sh_audio(demuxer, stream_id, NULL);
@@ -1675,14 +1668,11 @@
 		    if (priv->is_multirate && ((demuxer->video->id == -1) ||
 		                               ((demuxer->video->id >= 0) && priv->v_bitrate && (bitrate > priv->v_bitrate)))) {
 			    demuxer->video->id = stream_id;
+			    demuxer->video->sh = sh;
 			    priv->v_bitrate = bitrate;
 			    mp_msg(MSGT_DEMUX,MSGL_DBG2,"Multirate autoselected video id %d with bitrate %d\n", stream_id, bitrate);
 		    }
 
-		    if(demuxer->video->id==stream_id){
-			demuxer->video->sh=sh;
-		    }
-
 		    ++v_streams;
 
 		} // VIDO