Advertisement
Guest User

Untitled

a guest
Aug 10th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.32 KB | None | 0 0
  1. From dc054938d294ad16f359d048b8e30f7369a9c7df Mon Sep 17 00:00:00 2001
  2. From: Hendrik Leppkes <h.leppkes@gmail.com>
  3. Date: Sun, 11 Aug 2019 02:37:55 +0200
  4. Subject: [PATCH] lavd/lavfi: set timebase for subcc streams
  5.  
  6. ---
  7. libavdevice/lavfi.c | 3 +++
  8.  1 file changed, 3 insertions(+)
  9.  
  10. diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
  11. index ca8f05f3f7..0040a4ef56 100644
  12. --- a/libavdevice/lavfi.c
  13. +++ b/libavdevice/lavfi.c
  14. @@ -104,11 +104,14 @@ static int create_subcc_streams(AVFormatContext *avctx)
  15.      for (stream_idx = 0; stream_idx < lavfi->nb_sinks; stream_idx++) {
  16.          sink_idx = lavfi->stream_sink_map[stream_idx];
  17.          if (lavfi->sink_stream_subcc_map[sink_idx]) {
  18. +            AVFilterContext *sink = lavfi->sinks[lavfi->stream_sink_map[stream_idx]];
  19. +            AVRational time_base = av_buffersink_get_time_base(sink);
  20.              lavfi->sink_stream_subcc_map[sink_idx] = avctx->nb_streams;
  21.              if (!(st = avformat_new_stream(avctx, NULL)))
  22.                  return AVERROR(ENOMEM);
  23.              st->codecpar->codec_id = AV_CODEC_ID_EIA_608;
  24.              st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
  25. +            avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
  26.          } else {
  27.              lavfi->sink_stream_subcc_map[sink_idx] = -1;
  28.          }
  29. --
  30. 2.20.1.windows.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement