]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '962d63157322466a9a82f9f9d84c1b6f1b582f65'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 29 May 2014 11:40:42 +0000 (13:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 29 May 2014 11:43:04 +0000 (13:43 +0200)
* commit '962d63157322466a9a82f9f9d84c1b6f1b582f65':
  matroskaenc: set the stream timebase earlier

Conflicts:
tests/ref/lavf/mkv
tests/ref/seek/lavf-mkv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/matroskaenc.c

index c139339634f20def815a838dae7f81090bfe0cf3,f6af0f832493e13ac4255361384e452e6d1bdbb0..846c4479563f0ae5ada193cdb247223d21efc1c3
@@@ -677,10 -618,11 +677,13 @@@ static int mkv_write_tracks(AVFormatCon
          int bit_depth = av_get_bits_per_sample(codec->codec_id);
          int sample_rate = codec->sample_rate;
          int output_sample_rate = 0;
 +        int display_width_div = 1;
 +        int display_height_div = 1;
          AVDictionaryEntry *tag;
  
+         // ms precision is the de-facto standard timescale for mkv files
+         avpriv_set_pts_info(st, 64, 1, 1000);
          if (codec->codec_type == AVMEDIA_TYPE_ATTACHMENT) {
              mkv->have_attachments = 1;
              continue;
                  break;
              default:
                  av_log(s, AV_LOG_ERROR, "Only audio, video, and subtitles are supported for Matroska.\n");
 -                break;
 +                return AVERROR(EINVAL);
 +        }
 +
 +        if (mkv->mode != MODE_WEBM || codec->codec_id != AV_CODEC_ID_WEBVTT) {
 +            ret = mkv_write_codecprivate(s, pb, codec, native_id, qt_id);
 +            if (ret < 0) return ret;
          }
 -        ret = mkv_write_codecprivate(s, pb, codec, native_id, qt_id);
 -        if (ret < 0) return ret;
  
          end_ebml_master(pb, track);
-         // ms precision is the de-facto standard timescale for mkv files
-         avpriv_set_pts_info(st, 64, 1, 1000);
      }
      end_ebml_master(pb, tracks);
      return 0;