]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_epg.c
Fixed :drop-late-frames= inheritance in vout.
[vlc] / src / video_output / video_epg.c
index 71843e0029353d169f0fb70e937c2a74b294dadf..669bf91e03b39add7dbbd49c58fd3540aeadec00 100644 (file)
@@ -40,7 +40,6 @@
 #define EPG_NAME_SIZE 0.05
 #define EPG_PROGRAM_SIZE 0.03
 
-#define NO_EPG N_( "No EPG found for this program." )
 
 
 static subpicture_region_t * vout_OSDEpgSlider( vout_thread_t *p_vout,
@@ -55,6 +54,8 @@ static subpicture_region_t * vout_OSDEpgSlider( vout_thread_t *p_vout,
     video_format_Init( &fmt, VLC_CODEC_YUVA );
     fmt.i_width = fmt.i_visible_width = i_width;
     fmt.i_height = fmt.i_visible_height = i_height;
+    fmt.i_sar_num = 0;
+    fmt.i_sar_den = 1;
 
     p_region = subpicture_region_New( &fmt );
     if( !p_region )
@@ -113,6 +114,8 @@ static subpicture_region_t * vout_OSDEpgText( vout_thread_t *p_vout,
 
     /* Create a new subpicture region */
     video_format_Init( &fmt, VLC_CODEC_TEXT );
+    fmt.i_sar_num = 0;
+    fmt.i_sar_den = 1;
 
     p_region = subpicture_region_New( &fmt );
     if( !p_region )
@@ -230,23 +233,6 @@ int vout_OSDEpg( vout_thread_t *p_vout, input_item_t *p_input )
     subpicture_t *p_spu;
     mtime_t i_now = mdate();
 
-    int i_visible_width = p_vout->fmt_in.i_width;
-    int i_visible_height = p_vout->fmt_in.i_height;
-
-    if( !p_input )
-        return VLC_EGENERIC;
-
-    p_spu = subpicture_New();
-    if( !p_spu )
-        return VLC_EGENERIC;
-
-    p_spu->i_channel = DEFAULT_CHAN;
-    p_spu->i_start = i_now;
-    p_spu->i_stop = i_now + 10000 * INT64_C(1000);
-    p_spu->b_ephemer = true;
-    p_spu->b_absolute = true;
-    p_spu->b_fade = false;
-
     char *psz_now_playing = input_item_GetNowPlaying( p_input );
     vlc_epg_t *p_epg = NULL;
 
@@ -269,25 +255,31 @@ int vout_OSDEpg( vout_thread_t *p_vout, input_item_t *p_input )
 
     vlc_mutex_unlock( &p_input->lock );
 
-    if( p_epg != NULL )
+    /* If no EPG event has been found. */
+    if( p_epg == NULL )
+        return VLC_EGENERIC;
+
+    p_spu = subpicture_New();
+    if( !p_spu )
     {
-        /* Build the EPG event subpictures. */
-        p_spu->p_region = vout_BuildOSDEpg( p_vout, p_epg,
-                                            i_visible_width,
-                                            i_visible_height );
         vlc_epg_Delete( p_epg );
+        return VLC_EGENERIC;
     }
-    else
-    {
-        /* If no EPG event has been found, then display a warning message. */
-        p_spu->p_region = vout_OSDEpgText( p_vout, NO_EPG,
-                                           i_visible_width * EPG_LEFT,
-                                           i_visible_height * EPG_TOP,
-                                           i_visible_height * EPG_NAME_SIZE,
-                                           0x00ffffff );
-    }
 
-    spu_DisplaySubpicture( p_vout->p_spu, p_spu );
+    p_spu->i_channel = DEFAULT_CHAN;
+    p_spu->i_start = i_now;
+    p_spu->i_stop = i_now + 3000 * INT64_C(1000);
+    p_spu->b_ephemer = true;
+    p_spu->b_absolute = true;
+    p_spu->b_fade = true;
+
+    /* Build the EPG event subpictures. */
+    p_spu->p_region = vout_BuildOSDEpg( p_vout, p_epg,
+                                        p_vout->fmt_in.i_width,
+                                        p_vout->fmt_in.i_height );
+
+    vlc_epg_Delete( p_epg );
+    spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_spu );
 
     return VLC_SUCCESS;
 }