@@ -1545,8 +1545,7 @@ int movie_init_norm(ctx_dev *cam)
15451545 cam->movie_norm =(ctx_movie*) mymalloc (sizeof (ctx_movie));
15461546
15471547 mystrftime (cam, tmp, sizeof (tmp)
1548- , cam->conf ->movie_filename .c_str ()
1549- , &cam->current_image ->imgts , NULL );
1548+ , cam->conf ->movie_filename .c_str (), NULL );
15501549
15511550 container = movie_init_container (cam);
15521551
@@ -1615,18 +1614,23 @@ int movie_init_motion(ctx_dev *cam)
16151614{
16161615 char tmp[PATH_MAX];
16171616 const char *container;
1617+ ctx_image_data save_data;
16181618 int retcd, len;
16191619
16201620 cam->movie_motion =(ctx_movie*)mymalloc (sizeof (ctx_movie));
16211621
1622- mystrftime (cam, tmp, sizeof (tmp)
1623- , cam->conf ->movie_filename .c_str ()
1624- , &cam->imgs .image_motion .imgts , NULL );
1622+ /* copy pointers and meta data to current image for use in format*/
1623+ memcpy (&save_data, cam->current_image , sizeof (ctx_image_data));
1624+ memcpy (cam->current_image , &cam->imgs .image_motion , sizeof (ctx_image_data));
1625+ mystrftime (cam, tmp, sizeof (tmp)
1626+ , cam->conf ->movie_filename .c_str (), NULL );
1627+ memcpy (cam->current_image , &save_data, sizeof (ctx_image_data));
1628+
16251629 container = movie_init_container (cam);
16261630
16271631 /* The increment of 10 is to allow for the extension and other chars*/
16281632 len = (int )(strlen (tmp) + cam->conf ->target_dir .length () + 10 );
1629- cam->movie_norm ->full_nm = (char *)mymalloc (len);
1633+ cam->movie_motion ->full_nm = (char *)mymalloc (len);
16301634 if (mystreq (container, " test" )) {
16311635 retcd = snprintf (cam->movie_motion ->full_nm , len, " %s/%s_%sm"
16321636 , cam->conf ->target_dir .c_str (), container, tmp);
@@ -1636,13 +1640,13 @@ int movie_init_motion(ctx_dev *cam)
16361640 }
16371641
16381642 len = (int )cam->conf ->target_dir .length () + 10 ;
1639- cam->movie_norm ->movie_dir = (char *)mymalloc (len);
1640- retcd = snprintf (cam->movie_norm ->movie_dir ,len," %s"
1643+ cam->movie_motion ->movie_dir = (char *)mymalloc (len);
1644+ retcd = snprintf (cam->movie_motion ->movie_dir ,len," %s"
16411645 ,cam->conf ->target_dir .c_str ());
16421646
16431647 len = (int )strlen (tmp) + 10 ;
1644- cam->movie_norm ->movie_nm = (char *)mymalloc (len);
1645- retcd = snprintf (cam->movie_norm ->movie_nm , len, " %s" , tmp);
1648+ cam->movie_motion ->movie_nm = (char *)mymalloc (len);
1649+ retcd = snprintf (cam->movie_motion ->movie_nm , len, " %s" , tmp);
16461650
16471651 if (retcd < 0 ) {
16481652 MOTPLS_LOG (ERR, TYPE_ENCODER, NO_ERRNO
@@ -1688,8 +1692,7 @@ int movie_init_timelapse(ctx_dev *cam)
16881692
16891693 cam->movie_timelapse =(ctx_movie*)mymalloc (sizeof (ctx_movie));
16901694 mystrftime (cam, tmp, sizeof (tmp)
1691- , cam->conf ->timelapse_filename .c_str ()
1692- , &cam->current_image ->imgts , NULL );
1695+ , cam->conf ->timelapse_filename .c_str (), NULL );
16931696
16941697 /* The increment of 10 is to allow for the extension and other chars*/
16951698 len = (int )(strlen (tmp) + cam->conf ->target_dir .length () + 10 );
@@ -1760,8 +1763,7 @@ int movie_init_extpipe(ctx_dev *cam)
17601763 char filename[PATH_MAX] = " " ;
17611764
17621765 mystrftime (cam, filename, sizeof (filename)
1763- , cam->conf ->movie_filename .c_str ()
1764- , &cam->current_image ->imgts , NULL );
1766+ , cam->conf ->movie_filename .c_str (), NULL );
17651767 if (cam->conf ->movie_output ) {
17661768 MOTPLS_LOG (NTC, TYPE_STREAM, NO_ERRNO
17671769 , _ (" Requested extpipe in addition to movie_output." ));
@@ -1782,8 +1784,7 @@ int movie_init_extpipe(ctx_dev *cam)
17821784 }
17831785
17841786 mystrftime (cam, cam->extpipe_cmdline , sizeof (cam->extpipe_cmdline )
1785- , cam->conf ->movie_extpipe .c_str ()
1786- , &cam->current_image ->imgts , cam->extpipe_filename );
1787+ , cam->conf ->movie_extpipe .c_str (), cam->extpipe_filename );
17871788
17881789 MOTPLS_LOG (NTC, TYPE_EVENTS, NO_ERRNO
17891790 , _ (" fps %d pipe cmd: %s" )
0 commit comments