]> git.sesse.net Git - vlc/blobdiff - modules/codec/realvideo.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / codec / realvideo.c
index 8c00e9bd98982f749d7f0b1b4cf9992a3e305c65..3e43f56c97134f9a4d1033e55c801517d5ea6bda 100644 (file)
@@ -26,8 +26,6 @@
 # include "config.h"
 #endif
 
-#include <assert.h>
-
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
@@ -216,7 +214,9 @@ static int InitVideo(decoder_t *p_dec)
     int  i_vide = p_dec->fmt_in.i_extra;
     unsigned int *p_vide = p_dec->fmt_in.p_extra;
     decoder_sys_t *p_sys = calloc( 1, sizeof( decoder_sys_t ) );
-    assert( p_sys );
+
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     if( i_vide < 8 )
     {
@@ -355,7 +355,8 @@ static int InitVideo(decoder_t *p_dec)
      
     p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
     p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height;
-    p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->fmt_in.video.i_width / p_dec->fmt_in.video.i_height;
+    p_dec->fmt_out.video.i_sar_num = 1;
+    p_dec->fmt_out.video.i_sar_den = 1;
     p_sys->inited = 0;
 
     vlc_mutex_unlock( &rm_mutex );
@@ -372,9 +373,6 @@ static int Open( vlc_object_t *p_this )
 {
     decoder_t *p_dec = (decoder_t*)p_this;
 
-    /* create a mutex */
-    var_Create( p_this->p_libvlc, "rm_mutex", VLC_VAR_MUTEX );
-
     switch ( p_dec->fmt_in.i_codec )
     {
     case VLC_CODEC_RV10: 
@@ -456,7 +454,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
     p_block = *pp_block;
     *pp_block = NULL;
 
-    i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
+    i_pts = (p_block->i_pts > VLC_TS_INVALID) ? p_block->i_pts : p_block->i_dts;
 
     vlc_mutex_lock( &rm_mutex );
 
@@ -527,7 +525,8 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
                     p_dec->fmt_out.video.i_visible_height = 
                     p_dec->fmt_in.video.i_height= transform_out[4];
 
-                    p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->fmt_in.video.i_width / p_dec->fmt_in.video.i_height;
+                    p_dec->fmt_out.video.i_sar_num = 1;
+                    p_dec->fmt_out.video.i_sar_den = 1;
                 }
                 else
                 {