[MPlayer-cvslog] r19216 - trunk/libmpdemux/demux_avs.c

reimar subversion at mplayerhq.hu
Fri Jul 28 16:37:42 CEST 2006


Author: reimar
Date: Fri Jul 28 16:37:41 2006
New Revision: 19216

Modified:
   trunk/libmpdemux/demux_avs.c

Log:
Move variable declarations to the block level where they are actually used


Modified: trunk/libmpdemux/demux_avs.c
==============================================================================
--- trunk/libmpdemux/demux_avs.c	(original)
+++ trunk/libmpdemux/demux_avs.c	Fri Jul 28 16:37:41 2006
@@ -174,11 +174,6 @@
     demux_stream_t *d_video=demuxer->video;
     sh_video_t *sh_video=d_video->sh;
 
-#ifdef ENABLE_AUDIO
-    demux_stream_t *d_audio=demuxer->audio;
-    sh_audio_t *sh_audio=d_audio->sh;
-#endif
-    
     if (AVS->video_info->num_frames < AVS->frameno) return 0; // EOF
     
     curr_frame = AVS->avs_get_frame(AVS->clip, AVS->frameno);
@@ -205,6 +200,8 @@
     /* Audio */
     if (avs_has_audio(AVS->video_info))
     {
+        demux_stream_t *d_audio=demuxer->audio;
+        sh_audio_t *sh_audio=d_audio->sh;
         int l = sh_audio->wf->nAvgBytesPerSec;
         dp = new_demux_packet(l);
         
@@ -224,10 +221,6 @@
 
 static demuxer_t* demux_open_avs(demuxer_t* demuxer)
 {
-    sh_video_t *sh_video = NULL;
-#ifdef ENABLE_AUDIO
-    sh_audio_t *sh_audio = NULL;
-#endif
     int found = 0;
     AVS_T *AVS = (AVS_T *) demuxer->priv;
     AVS->frameno = 0;
@@ -279,8 +272,8 @@
     /* Video */  
     if (avs_has_video(AVS->video_info))
     {
+        sh_video_t *sh_video = new_sh_video(demuxer, 0);
         found = 1;
-        sh_video = new_sh_video(demuxer, 0);
         
         demuxer->video->sh = sh_video;
         sh_video->ds = demuxer->video;
@@ -308,10 +301,10 @@
     /* Audio */
     if (avs_has_audio(AVS->video_info))
     {
+        sh_audio_t *sh_audio = new_sh_audio(demuxer, 0);
         found = 1;
         mp_msg(MSGT_DEMUX, MSGL_V, "AVS: Clip has audio -> Channels = %d - Freq = %d\n", AVS->video_info->nchannels, AVS->video_info->audio_samples_per_second);
 
-        sh_audio = new_sh_audio(demuxer, 0);
         demuxer->audio->sh = sh_audio;
         sh_audio->ds = demuxer->audio;
         



More information about the MPlayer-cvslog mailing list