]> git.sesse.net Git - vlc/blobdiff - modules/codec/rawvideo.c
Added support for explicit HeV2 LOAS/LATM stream in packetizer.
[vlc] / modules / codec / rawvideo.c
index cfb49345913f15cb268f392f0959b5c74b63e239..e79e2edff172683498be140b54ebfc5d9515d335 100644 (file)
@@ -153,16 +153,16 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
 
+    date_Init( &p_sys->pts, p_dec->fmt_out.video.i_frame_rate,
+               p_dec->fmt_out.video.i_frame_rate_base );
     if( p_dec->fmt_out.video.i_frame_rate == 0 ||
         p_dec->fmt_out.video.i_frame_rate_base == 0)
     {
-        msg_Err( p_dec, "invalid frame rate %d/%d",
-                 p_dec->fmt_out.video.i_frame_rate,
-                 p_dec->fmt_out.video.i_frame_rate_base);
-        return VLC_EGENERIC;
+        msg_Warn( p_dec, "invalid frame rate %d/%d, using 25 fps instead",
+                  p_dec->fmt_out.video.i_frame_rate,
+                  p_dec->fmt_out.video.i_frame_rate_base);
+        date_Init( &p_sys->pts, 25, 1 );
     }
-    date_Init( &p_sys->pts, p_dec->fmt_out.video.i_frame_rate,
-               p_dec->fmt_out.video.i_frame_rate_base);
 
     /* Find out p_vdec->i_raw_size */
     vout_InitFormat( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
@@ -213,7 +213,8 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
     p_block = *pp_block;
 
-    if( (!p_block->i_pts || !p_block->i_dts) && !date_Get( &p_sys->pts ) )
+
+    if( !p_block->i_pts && !p_block->i_dts && !date_Get( &p_sys->pts ) )
     {
         /* We've just started the stream, wait for the first PTS. */
         block_Release( p_block );