]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparseogm.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / oggparseogm.c
index 36f61c7680f8714056ac97b7b64f19e1becccdb2..43243f042f1203481360cbbcf63afa4c89e50159 100644 (file)
@@ -84,14 +84,12 @@ ogm_header(AVFormatContext *s, int idx)
         if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
             st->codec->width = bytestream_get_le32(&p);
             st->codec->height = bytestream_get_le32(&p);
-            st->codec->time_base.den = spu * 10000000;
-            st->codec->time_base.num = time_unit;
-            avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
+            avpriv_set_pts_info(st, 64, time_unit, spu * 10000000);
         } else {
             st->codec->channels = bytestream_get_le16(&p);
             p += 2;                 /* block_align */
             st->codec->bit_rate = bytestream_get_le32(&p) * 8;
-            st->codec->sample_rate = spu * 10000000 / time_unit;
+            st->codec->sample_rate = time_unit ? spu * 10000000 / time_unit : 0;
             avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
             if (size >= 56 && st->codec->codec_id == CODEC_ID_AAC) {
                 p += 4;
@@ -132,8 +130,7 @@ ogm_dshow_header(AVFormatContext *s, int idx)
     if(t == 0x05589f80){
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
         st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68));
-        st->codec->time_base.den = 10000000;
-        st->codec->time_base.num = AV_RL64(p + 164);
+        avpriv_set_pts_info(st, 64, AV_RL64(p + 164), 10000000);
         st->codec->width = AV_RL32(p + 176);
         st->codec->height = AV_RL32(p + 180);
     } else if(t == 0x05589f81){