Use correct clock when checking whether to write a new PCR
authorJan Schmidt <thaytan@noraisin.net>
Sat, 26 Mar 2011 05:12:18 +0000 (16:12 +1100)
committerJan Schmidt <thaytan@noraisin.net>
Sat, 26 Mar 2011 05:18:22 +0000 (16:18 +1100)
The PCR clocks against the 27MHz SCR clock, so check it correctly
to avoid writing the PCR too often.

Partially fixes: #611046

gst/mpegtsmux/tsmux/tsmux.c

index 1a50e72246b6514d3129f18e449dd1eb690640f3..e160197029c11c6e3b7574d47e8e8bb2a811011b 100644 (file)
@@ -723,7 +723,7 @@ tsmux_write_stream_packet (TsMux * mux, TsMuxStream * stream)
     /* Need to decide whether to write a new PCR in this packet */
     if (stream->last_pcr == -1 ||
         (cur_pcr - stream->last_pcr >
-            (TSMUX_CLOCK_FREQ / TSMUX_DEFAULT_PCR_FREQ))) {
+            (TSMUX_SYS_CLOCK_FREQ / TSMUX_DEFAULT_PCR_FREQ))) {
 
       stream->pi.flags |=
           TSMUX_PACKET_FLAG_ADAPTATION | TSMUX_PACKET_FLAG_WRITE_PCR;