]> git.sesse.net Git - vlc/commitdiff
Move most of the parameters out of p_sys.
authorSteinar H. Gunderson <steinar+vlc@gunderson.no>
Fri, 1 Oct 2010 23:59:10 +0000 (01:59 +0200)
committerSteinar H. Gunderson <steinar+vlc@gunderson.no>
Fri, 1 Oct 2010 23:59:10 +0000 (01:59 +0200)
modules/access/decklink.cpp

index 79f1d958b99a1c833e0127484505e1516228062d..1afee5450c794d3e292fedfaa2fdfdb00d717da8 100644 (file)
@@ -127,10 +127,8 @@ struct demux_sys_t
     bool b_first_frame;
     int i_last_pts;
 
-    int i_width, i_height, i_fps_num, i_fps_den;
     uint32_t i_dominance_flags;
-
-    int i_rate, i_channels;
+    int i_channels;
 
     vlc_mutex_t frame_lock;
     block_t *p_video_frame;  /* protected by <frame_lock> */
@@ -276,6 +274,8 @@ static int Open( vlc_object_t *p_this )
     char        *psz_audio_connection = NULL;
     bool        b_found_mode;
     int         i_card_index;
+    int         i_width, i_height, i_fps_num, i_fps_den;
+    int         i_rate;
 
     /* Only when selected */
     if( *p_demux->psz_access == '\0' )
@@ -506,10 +506,10 @@ static int Open( vlc_object_t *p_this )
         if( wanted_mode_id == mode_id )
         {
             b_found_mode = true;
-            p_sys->i_width = p_display_mode->GetWidth();
-            p_sys->i_height = p_display_mode->GetHeight();
-            p_sys->i_fps_num = time_scale;
-            p_sys->i_fps_den = frame_duration;
+            i_width = p_display_mode->GetWidth();
+            i_height = p_display_mode->GetHeight();
+            i_fps_num = time_scale;
+            i_fps_den = frame_duration;
             p_sys->i_dominance_flags = i_dominance_flags;
         }
 
@@ -534,11 +534,11 @@ static int Open( vlc_object_t *p_this )
     }
 
     /* Set up audio. */
-    p_sys->i_rate = var_InheritInteger( p_demux, "decklink-audio-rate" );
     p_sys->i_channels = var_InheritInteger( p_demux, "decklink-audio-channels" );
-    if( p_sys->i_rate > 0 && p_sys->i_channels > 0 )
+    i_rate = var_InheritInteger( p_demux, "decklink-audio-rate" );
+    if( i_rate > 0 && p_sys->i_channels > 0 )
     {
-        result = p_sys->p_input->EnableAudioInput( p_sys->i_rate, bmdAudioSampleType16bitInteger, p_sys->i_channels );
+        result = p_sys->p_input->EnableAudioInput( i_rate, bmdAudioSampleType16bitInteger, p_sys->i_channels );
         if( result != S_OK )
         {
             msg_Err( p_demux, "Failed to enable audio input" );
@@ -562,12 +562,12 @@ static int Open( vlc_object_t *p_this )
     /* Declare elementary streams */
     es_format_t video_fmt;
     es_format_Init( &video_fmt, VIDEO_ES, VLC_CODEC_UYVY );
-    video_fmt.video.i_width = p_sys->i_width;
-    video_fmt.video.i_height = p_sys->i_height;
+    video_fmt.video.i_width = i_width;
+    video_fmt.video.i_height = i_height;
     video_fmt.video.i_sar_num = 1;
     video_fmt.video.i_sar_den = 1;
-    video_fmt.video.i_frame_rate = p_sys->i_fps_num;
-    video_fmt.video.i_frame_rate_base = p_sys->i_fps_den;
+    video_fmt.video.i_frame_rate = i_fps_num;
+    video_fmt.video.i_frame_rate_base = i_fps_den;
     video_fmt.i_bitrate = video_fmt.video.i_width * video_fmt.video.i_height * video_fmt.video.i_frame_rate * 2 * 8;
 
     psz_aspect = var_CreateGetNonEmptyString( p_demux, "decklink-aspect-ratio" );
@@ -590,7 +590,7 @@ static int Open( vlc_object_t *p_this )
     es_format_t audio_fmt;
     es_format_Init( &audio_fmt, AUDIO_ES, VLC_CODEC_S16N );
     audio_fmt.audio.i_channels = p_sys->i_channels;
-    audio_fmt.audio.i_rate = p_sys->i_rate;
+    audio_fmt.audio.i_rate = i_rate;
     audio_fmt.audio.i_bitspersample = 16;
     audio_fmt.audio.i_blockalign = audio_fmt.audio.i_channels * audio_fmt.audio.i_bitspersample / 8;
     audio_fmt.i_bitrate = audio_fmt.audio.i_channels * audio_fmt.audio.i_rate * audio_fmt.audio.i_bitspersample;