RaspiVid: Segment PTS file too if set
authorDave Stevenson <6by9@users.noreply.github.com>
Thu, 10 Nov 2016 23:17:23 +0000 (23:17 +0000)
committerpopcornmix <popcornmix@gmail.com>
Fri, 11 Nov 2016 17:47:16 +0000 (17:47 +0000)
IMV and encoded video streams would be segmented
by the -sg option, but not the PTS file. Segment
PTS file too.

host_applications/linux/apps/raspicam/RaspiVid.c

index 586214ec03036db0d717bf45f89f4dbded682495..807e07ae277dbdd979c7d648c308851bd735f7d2 100755 (executable)
@@ -1214,6 +1214,17 @@ static void encoder_buffer_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf
                   pData->imv_file_handle = new_handle;
                }
             }
+
+            if (pData->pstate->pts_filename && pData->pstate->pts_filename[0] != '-')
+            {
+               new_handle = open_filename(pData->pstate, pData->pstate->pts_filename);
+
+               if (new_handle)
+               {
+                  fclose(pData->pts_file_handle);
+                  pData->pts_file_handle = new_handle;
+               }
+            }
          }
          if (buffer->length)
          {