diff --git a/.cvsignore b/.cvsignore index ef65e62..7bf5885 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,3 @@ dvgrab-2.0.tar.gz dvgrab-2.1.tar.gz +dvgrab-3.0.tar.gz diff --git a/dvgrab-3.0-fixes.patch b/dvgrab-3.0-fixes.patch new file mode 100644 index 0000000..df79cbc --- /dev/null +++ b/dvgrab-3.0-fixes.patch @@ -0,0 +1,164 @@ +diff -Naurp dvgrab-3.0.orig/dvgrab.cc dvgrab-3.0/dvgrab.cc +--- dvgrab-3.0.orig/dvgrab.cc 2007-08-06 23:00:43.000000000 -0400 ++++ dvgrab-3.0/dvgrab.cc 2007-10-22 17:22:18.000000000 -0400 +@@ -436,9 +436,6 @@ void DVgrab::getargs( int argc, char *ar + print_version(); + exit( EXIT_SUCCESS ); + break; +- case '-': +- m_raw_pipe = true; +- break; + default: + print_usage(); + exit( EXIT_FAILURE ); +@@ -447,15 +444,31 @@ void DVgrab::getargs( int argc, char *ar + + if ( optind < argc ) + { ++ if ( argv[ optind ][0] == '-' ) ++ { ++ m_raw_pipe = true; ++ ++optind; ++ } ++ } ++ if ( optind < argc ) ++ { + m_dst_file_name = argv[ optind++ ]; + set_format_from_name(); + } + + if ( optind < argc ) + { +- cerr << "Too many output file names." << endl; +- print_usage(); +- exit( EXIT_FAILURE ); ++ if ( argv[ optind ][0] == '-' ) ++ { ++ m_raw_pipe = true; ++ ++optind; ++ } ++ else ++ { ++ cerr << "Too many output file names." << endl; ++ print_usage(); ++ exit( EXIT_FAILURE ); ++ } + } + + if ( m_dst_file_name == NULL && !m_raw_pipe ) +diff -Naurp dvgrab-3.0.orig/filehandler.cc dvgrab-3.0/filehandler.cc +--- dvgrab-3.0.orig/filehandler.cc 2007-07-28 23:47:15.000000000 -0400 ++++ dvgrab-3.0/filehandler.cc 2007-10-22 17:25:53.000000000 -0400 +@@ -41,6 +41,7 @@ using std::setfill; + #include + #include + #include ++#include + + #include "filehandler.h" + #include "error.h" +@@ -459,6 +460,32 @@ TimeSys: + return true; + } + ++static ssize_t writen( int fd, unsigned char *vptr, size_t n ) ++{ ++ size_t nleft = n; ++ ssize_t nwritten; ++ unsigned char *ptr = vptr; ++ ++ while ( nleft > 0 ) ++ { ++ if ( ( nwritten = write( fd, ptr, nleft ) ) <= 0 ) ++ { ++ if ( errno == EINTR ) ++ { ++ nwritten = 0; ++ } ++ else ++ { ++ n = -1; ++ break; ++ } ++ } ++ nleft -= nwritten; ++ ptr += nwritten; ++ } ++ return n; ++} ++ + /***************************************************************************/ + + +@@ -497,7 +524,7 @@ bool RawHandler::Create( const string& f + + int RawHandler::Write( Frame *frame ) + { +- int result = write( fd, frame->data, frame->GetDataLen() ); ++ int result = writen( fd, frame->data, frame->GetDataLen() ); + return result; + } + +@@ -1261,12 +1288,12 @@ int Mpeg2Handler::Write( Frame *frame ) + // Write any buffered data first. + if ( bufferLen > 0 ) + { +- if ( 0 > ( result = write( fd, buffer, bufferLen ) ) ) ++ if ( 0 > ( result = writen( fd, buffer, bufferLen ) ) ) + return result; + bufferLen = 0; + } + +- result = write( fd, frame->data, frame->GetDataLen() ); ++ result = writen( fd, frame->data, frame->GetDataLen() ); + + if ( 0 <= result ) + totalFrames++; +diff -Naurp dvgrab-3.0.orig/ieee1394io.cc dvgrab-3.0/ieee1394io.cc +--- dvgrab-3.0.orig/ieee1394io.cc 2007-07-07 03:10:12.000000000 -0400 ++++ dvgrab-3.0/ieee1394io.cc 2007-10-22 17:14:52.000000000 -0400 +@@ -432,14 +432,18 @@ bool iec61883Reader::Open() + + void iec61883Reader::Close() + { +- if ( m_iec61883.ref != NULL ) +- { +- if ( isHDV ) ++ if ( isHDV ) { ++ if ( m_iec61883.mpeg2 != NULL ) { + iec61883_mpeg2_close( m_iec61883.mpeg2 ); +- else ++ m_iec61883.mpeg2 = NULL; ++ } ++ } ++ else ++ { ++ if ( m_iec61883.dv != NULL ) { + iec61883_dv_fb_close( m_iec61883.dv ); +- +- m_iec61883.dv = NULL; ++ m_iec61883.dv = NULL; ++ } + } + } + +@@ -470,9 +474,9 @@ void iec61883Reader::StopReceive() + if ( m_iec61883.ref != NULL ) + { + if ( isHDV ) +- iec61883_mpeg2_close( m_iec61883.mpeg2 ); ++ iec61883_mpeg2_recv_stop( m_iec61883.mpeg2 ); + else +- iec61883_dv_fb_close( m_iec61883.dv ); ++ iec61883_dv_fb_stop( m_iec61883.dv ); + + m_iec61883.ref = NULL; + } +@@ -1085,6 +1089,7 @@ void* pipeReader::Thread() + pthread_mutex_lock( &mutex ); + if ( currentFrame ) outFrames.push_back( currentFrame ); + currentFrame = NULL; ++ outFrames.push_back( currentFrame ); + TriggerAction( ); + pthread_mutex_unlock( &mutex ); + return NULL; diff --git a/dvgrab.spec b/dvgrab.spec index fd6f029..07f47a2 100644 --- a/dvgrab.spec +++ b/dvgrab.spec @@ -1,11 +1,12 @@ Summary: Utility to capture video from a DV camera Name: dvgrab -Version: 2.1 -Release: 3%{?dist} +Version: 3.0 +Release: 2%{?dist} License: GPL Group: Applications/Multimedia URL: http://www.kinodv.org/ Source: http://dl.sf.net/kino/dvgrab-%{version}.tar.gz +Patch: dvgrab-3.0-fixes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libraw1394-devel libavc1394-devel libdv-devel libiec61883-devel BuildRequires: libjpeg-devel libpng-devel libogg-devel libvorbis-devel @@ -17,6 +18,7 @@ The dvgrab utility will capture digital video from a DV source on the firewire %prep %setup -q +%patch -p1 %build %configure @@ -36,6 +38,15 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/dvgrab.1* %changelog +* Mon Oct 22 2007 Jarod Wilson - 3.0-2 +- Fix segfault on cleanup (#331271) +- fix pipe output in conjunction with file capture +- fix hang at end of reading from stdin +- fix potential data loss due to short writes + +* Sun Oct 07 2007 Jarod Wilson - 3.0-1 +- New upstream release + * Sun Feb 04 2007 Jarod Wilson - 2.1-3 - Minor clean-ups for core/extras merge review (#225713) diff --git a/sources b/sources index df38699..b7c1cc1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6793471d7b5c29788371d8102f013306 dvgrab-2.1.tar.gz +7ac49e0c183fb5b9c7496fb92bdc6d07 dvgrab-3.0.tar.gz