[vlc-commits] demux: ogg: fix new ogm header frame rate

Francois Cartegnie git at videolan.org
Wed Jun 6 16:47:24 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jun  6 16:21:40 2018 +0200| [21fe255eabb31374af69f3f0a3eb64bed6d81ddf] | committer: Francois Cartegnie

demux: ogg: fix new ogm header frame rate

refs 0002.ogv

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21fe255eabb31374af69f3f0a3eb64bed6d81ddf
---

 modules/demux/ogg.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index c313c88d10..181cc78ef9 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1889,10 +1889,13 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
                         msg_Dbg( p_demux, "found video header of type: %.4s",
                                  (char *)&p_stream->fmt.i_codec );
 
+                        /* FIXME: no clue where it's from */
                         if( st->time_unit <= 0 )
                             st->time_unit = 400000;
-                        unsigned num,den;
-                        vlc_ureduce( &num, &den, OGGDS_RESOLUTION, st->time_unit,
+                        unsigned num, den;
+                        vlc_ureduce( &num, &den,
+                                     st->samples_per_unit * OGGDS_RESOLUTION,
+                                     st->time_unit > 0 ? st->time_unit : OGGDS_RESOLUTION,
                                      OGGDS_RESOLUTION );
                         date_Init( &p_stream->dts, num, den );
                         p_stream->fmt.video.i_frame_rate = num;
@@ -1949,6 +1952,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
                         i_format_tag = strtol(p_buffer,NULL,16);
                         p_stream->fmt.audio.i_channels = st->sh.audio.channels;
                         fill_channels_info(&p_stream->fmt.audio);
+
                         unsigned num,den;
                         vlc_ureduce( &num, &den,
                                      st->samples_per_unit * OGGDS_RESOLUTION,



More information about the vlc-commits mailing list