From 91bdced363cd21250b55667b6dbef96c676d26fc Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 10 Jun 2012 16:50:06 +0200
Subject: [PATCH] mpegtsenc: prevent pcr_packet_period==0

a period of 1 is the smallest that makes sense

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavformat/mpegtsenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fd30e7053fc..3517d74830a 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -659,6 +659,8 @@ static int mpegts_write_header(AVFormatContext *s)
             service->pcr_packet_period =
                 pcr_st->codec->time_base.den/(10*pcr_st->codec->time_base.num);
         }
+        if(!service->pcr_packet_period)
+            service->pcr_packet_period = 1;
     }
 
     // output a PCR as soon as possible
-- 
GitLab