Package-Name: transcode-cvs
Conflicts: transcode
Requires: jpeg ffmpeg|ffmpeg-cvs libmpeg2
Suggests: lame libdv libdvdread mjpegtools|mjpegtools-cvs
Rebuild-For: ImageMagick SDL Xorg a52dec avifile gtk+ ibp jpeg libfame liblzo libmpeg3 libogg libquicktime libtheora libvorbis libxio libxml2
Compile-Requires: pkgconfig autoconf automake libtool
Homepage: http://www.transcoding.org
Source: cvs://cvs@cvs.exit1.org/cvstc/transcode/(.*) $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
	mv transcode transcode-cvs-"$(VERSION)"
Compile:
	cp -af AUTHORS COPYING ChangeLog README TODO "$(PREFIX)/"
	autoreconf -i
	set -e; for pkgopt in ImageMagick:imagemagick SDL:sdl a52dec:a52 avifile:avifile gtk+:gtk ibp:ibp jpeg:libjpeg lame:lame libdv:libdv libdvdread:libdvdread libfame:libfame liblzo:lzo libmpeg3:libmpeg3 libogg:ogg libquicktime:libquicktime libtheora:theora libvorbis:vorbis libxio:xio libxml2:libxml2 mjpegtools:mjpegtools ; do \
		pkg=`echo $$pkgopt | cut -d: -f1`; \
		opt=`echo $$pkgopt | cut -d: -f2`; \
		var=`echo $$pkg | tr a-z- A-Z_`; \
		if packager c $$pkg; then \
			eval "$$var=--enable-$$opt"; \
		else \
			eval "$$var=--disable-$$opt"; \
		fi; \
	done; \
	if test "x$$SDL$$GTK$$IMAGEMAGICK$$AVIFILE" != x; then \
		XLIBS="-Wl,-rpath,/usr/X11/lib"; \
	else \
		XLIBS=""; \
	fi; \
	LDFLAGS="$$XLIBS" $(MAKE) -f ../Makefile configure CONFIGURE_OPTS="$$FFMPEG --enable-v4l $$LAME $$LIBDV $$LIBDVDREAD $$MJPEGTOOLS $$LIBOGG $$LIBVORBIS $$JPEG $$IMAGEMAGICK --disable-a52"
	$(MAKE)
	$(MAKE) install
	rm -rf "$(PREFIX)"/bin/*-cvs
	set -e ; for i in "$(PREFIX)"/bin/* ; do \
		echo  >"$$i-cvs" '#!/bin/sh' ; \
		echo >>"$$i-cvs" 'PATH="$(PREFIX)/bin:$$PATH" exec "'"$$i"'" "$$@"' ; \
		chmod 755 "$$i-cvs" ; \
	done
	set -e ; for i in "$(PREFIX)"/man/man1/*.1 ; do \
		j=`echo "$$i" | sed 's/\.1$$/-cvs.1/'` ; \
		mv -f "$$i" "$$j" ; \
	done
	rm -rf "$(PREFIX)"/doc
	mv "$(PREFIX)"/share/doc/transcode "$(PREFIX)"/doc
	rmdir "$(PREFIX)"/share/doc
	rmdir "$(PREFIX)"/share
Install:
	$(MAKE) instbin BIN="avifix-cvs aviindex-cvs avimerge-cvs avisplit-cvs avisync-cvs tccat-cvs tcdecode-cvs tcdemux-cvs tcextract-cvs tcmodinfo-cvs tcmp3cut-cvs tcmplex-cvs tcprobe-cvs tcrequant-cvs tcscan-cvs tcxmlcheck-cvs tcxpm2rgb-cvs transcode-cvs"
	$(MAKE) instman SECTION=1 MAN="avifix-cvs aviindex-cvs avimerge-cvs avisplit-cvs avisync-cvs tccat-cvs tcdecode-cvs tcdemux-cvs tcextract-cvs tcmodinfo-cvs tcprobe-cvs tcpvmexportd-cvs tcscan-cvs tcxmlcheck-cvs transcode-cvs"
Patch: <<EOT
######## begin tcprobe DVD ISO support fix
Index: import/tcprobe.c
===================================================================
RCS file: /cvstc/transcode/import/tcprobe.c,v
retrieving revision 1.11
diff -u -r1.11 tcprobe.c
--- import/tcprobe.c	18 Oct 2004 02:04:15 -0000	1.11
+++ import/tcprobe.c	31 Oct 2004 13:54:52 -0000
@@ -98,7 +98,7 @@
     int ch, i, n, cc=0, probe_factor=1, skip=0;
 
 
-    int dvd_title=1;
+    int dvd_title=1, dvd_title_set=0;
     char *name=NULL;
     char *nav_seek_file=NULL;
 
@@ -178,6 +178,7 @@
 	  
 	  if(optarg[0]=='-') usage(EXIT_FAILURE);
 	  dvd_title = atoi(optarg);
+	  dvd_title_set = 1;
 
 	  break;
 	  
@@ -236,13 +237,22 @@
 	
       case 0:  //regular file
 	
-	if((ipipe.fd_in = xio_open(name, O_RDONLY))<0) {
-	  perror("file open");
-	  return(-1);
-	}
+	if(!dvd_title_set || dvd_verify(name)<0) {
+
+	  if((ipipe.fd_in = xio_open(name, O_RDONLY))<0) {
+	    perror("file open");
+	    return(-1);
+	  }
+
+	  stream_magic = fileinfo(ipipe.fd_in, skip);
+	  ipipe.seek_allowed = 1;
 
-	stream_magic = fileinfo(ipipe.fd_in, skip);
-	ipipe.seek_allowed = 1;
+	} else {  //DVD image
+
+	  stream_magic = TC_MAGIC_DVD;
+	  ipipe.seek_allowed = 0;
+
+	}
 
 	break;
 	
######## end tcprobe DVD ISO support fix
######## begin long WAV file fix
Index: import/extract_pcm.c
===================================================================
RCS file: /cvstc/transcode/import/extract_pcm.c,v
retrieving revision 1.9
diff -u -r1.9 extract_pcm.c
--- import/extract_pcm.c	21 Oct 2004 18:04:55 -0000	1.9
+++ import/extract_pcm.c	9 Nov 2004 01:22:37 -0000
@@ -252,7 +252,7 @@
 
   avi_t *avifile;
      
-  long frames, bytes, padding, n;
+  unsigned long frames, bytes, padding, n;
 
   int error=0;
 
######## end long WAV file fix
######## begin ETA counter bounciness fix
Index: src/counter.c
===================================================================
RCS file: /cvstc/transcode/src/counter.c,v
retrieving revision 1.7
diff -u -r1.7 counter.c
--- src/counter.c	6 Oct 2003 14:08:00 -0000	1.7
+++ src/counter.c	11 Nov 2004 19:04:37 -0000
@@ -103,7 +103,7 @@
 
       if(range_starttime == -1) range_starttime = tv.tv_sec;
       done = (double)(pidn-range_a)/(range_b-range_a);
-      secleft = (1-done)*(double)(tv.tv_sec-range_starttime)/done;
+      secleft = (range_b-pidn)/fps;
       
       if(!encoder_progress_flag) {
  	printf("%s frame [%d], %6.2f fps, %4.1f%%, ETA: %d:%02d:%02d, (%2d|%2d|%2d)  %c", s, pidn, fps, 100*done,
######## end ETA counter bounciness fix
EOT

/pkg/transcode/
/usr/bin/avifix-cvs
/usr/bin/aviindex-cvs
/usr/bin/avimerge-cvs
/usr/bin/avisplit-cvs
/usr/bin/avisync-cvs
/usr/bin/tccat-cvs
/usr/bin/tcdecode-cvs
/usr/bin/tcdemux-cvs
/usr/bin/tcextract-cvs
/usr/bin/tcmodinfo-cvs
/usr/bin/tcmp3cut-cvs
/usr/bin/tcmplex-cvs
/usr/bin/tcprobe-cvs
/usr/bin/tcrequant-cvs
/usr/bin/tcscan-cvs
/usr/bin/tcxmlcheck-cvs
/usr/bin/tcxpm2rgb-cvs
/usr/bin/transcode-cvs
/usr/man/man1/avifix-cvs.1.gz
/usr/man/man1/aviindex-cvs.1.gz
/usr/man/man1/avimerge-cvs.1.gz
/usr/man/man1/avisplit-cvs.1.gz
/usr/man/man1/avisync-cvs.1.gz
/usr/man/man1/tccat-cvs.1.gz
/usr/man/man1/tcdecode-cvs.1.gz
/usr/man/man1/tcdemux-cvs.1.gz
/usr/man/man1/tcextract-cvs.1.gz
/usr/man/man1/tcmodinfo-cvs.1.gz
/usr/man/man1/tcprobe-cvs.1.gz
/usr/man/man1/tcpvmexportd-cvs.1.gz
/usr/man/man1/tcscan-cvs.1.gz
/usr/man/man1/tcxmlcheck-cvs.1.gz
/usr/man/man1/transcode-cvs.1.gz
