]> git.sesse.net Git - vlc/blobdiff - modules/codec/realvideo.c
avcodec: revert define of deprecated values
[vlc] / modules / codec / realvideo.c
index c89068104566d160ed9b08c88b3d2f92a75030a4..c94a8aa4d1649c225502ea12ed2060d0065394d5 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 #include <vlc_codec.h>
 
 #ifdef LOADER
@@ -46,13 +45,8 @@ int WINAPI FreeLibrary( void *handle );
 #   define WINAPI
 #endif
 
-#if defined(HAVE_DL_DLOPEN)
-#   if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
-#       include <dlfcn.h>
-#   endif
-#   if defined(HAVE_SYS_DL_H)
-#       include <sys/dl.h>
-#   endif
+#ifndef WIN32
+#   include <dlfcn.h>
 #endif
 
 typedef struct cmsg_data_s
@@ -130,7 +124,7 @@ static picture_t *DecodeVideo( decoder_t *, block_t ** );
 
 vlc_module_begin ()
     set_description( N_("RealVideo library decoder") )
-    set_capability( "decoder", 10 )
+    set_capability( "decoder", 0 )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_VCODEC )
     set_callbacks( Open, Close )
@@ -214,8 +208,10 @@ 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 = malloc( sizeof( decoder_sys_t ) );
-    memset(p_sys,0,sizeof( decoder_sys_t ) );
+    decoder_sys_t *p_sys = calloc( 1, sizeof( decoder_sys_t ) );
+
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     if( i_vide < 8 )
     {
@@ -223,7 +219,7 @@ static int InitVideo(decoder_t *p_dec)
             free( p_sys );
             return VLC_EGENERIC;
     }
-    if (p_sys->plane) free(p_sys->plane);
+    free( p_sys->plane );
     p_sys->plane = malloc (p_dec->fmt_in.video.i_width*p_dec->fmt_in.video.i_height*3/2 + 1024 );
     if (NULL == p_sys->plane)
     {
@@ -354,7 +350,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 );
@@ -371,9 +368,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: 
@@ -420,11 +414,8 @@ static void Close( vlc_object_t *p_this )
 #endif
         p_sys->rv_handle=NULL;
 
-    if (p_sys->plane)
-    {
-        free(p_sys->plane);
-        p_sys->plane = NULL;
-    }
+    free( p_sys->plane );
+    p_sys->plane = NULL;
 
     msg_Dbg( p_dec, "FreeLibrary ok." );
 #ifdef LOADER
@@ -458,7 +449,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 );
 
@@ -470,7 +461,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         dp_hdr_t dp_hdr;
         transform_in_t transform_in;
         uint32_t pkg_len = ((uint32_t*)p_block->p_buffer)[0];
-        unsigned char* dp_data=((unsigned char*)p_block->p_buffer)+8;
+        char* dp_data=((char*)p_block->p_buffer)+8;
         uint32_t* extra=(uint32_t*)(((char*)p_block->p_buffer)+8+pkg_len);
         uint32_t img_size;
 
@@ -529,7 +520,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
                 {