You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.6 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../avview/ffmpeg-compat.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- avview-0.80.6/ffmpeg.c 2004-12-17 13:48:41.000000000 +0100
+++ avview-0.80.6.work/ffmpeg.c 2005-03-16 13:46:04.000000000 +0100
@@ -144,6 +144,7 @@
PACKET *f;
V4L_DATA *data;
AVFrame picture;
+AVPacket packet;
char *output_buf;
long ob_size, ob_free, ob_written;
long frames=0;
@@ -193,8 +194,12 @@
while(ob_written<ob_free){
pthread_mutex_lock(&(sdata->format_context_mutex));
if(sdata->format_context.oformat!=NULL){
- sdata->format_context.oformat->write_packet(&(sdata->format_context),sdata->video_stream_num, output_buf+ob_written, ob_free-ob_written, make_pts(start_ts, f->timestamp));
i=ob_free-ob_written;
+ packet.stream_index = sdata->video_stream_num;
+ packet.data = output_buf + ob_written;
+ packet.size = i;
+ packet.pts = make_pts(start_ts, f->timestamp);
+ packet.duration = 0;
} else {
i=write(sdata->fd_out, output_buf+ob_written, ob_free-ob_written);
}
@@ -301,6 +306,7 @@
int64 start_ts;
long ob_size, ob_free;
PACKET *f;
+AVPacket packet;
ob_size=sdata->audio_codec_context.frame_size*sdata->audio_codec_context.channels*sizeof(short);
out_buf=do_alloc(ob_size, 1);
fprintf(stderr,"audio_encoding pid %d\n", getpid());
@@ -324,7 +330,12 @@
/* write output buffer */
if(sdata->format_context.oformat!=NULL){
/* write using libavcodec format output */
- sdata->format_context.oformat->write_packet(&(sdata->format_context),sdata->audio_stream_num, out_buf, ob_free, make_pts(start_ts, f->timestamp));
+ packet.stream_index = sdata->video_stream_num;
+ packet.data = out_buf;
+ packet.size = ob_free;
+ packet.pts = make_pts(start_ts, f->timestamp);
+ packet.duration = 0;
+ sdata->format_context.oformat->write_packet(&(sdata->format_context), &packet);
} else {
/* write using os function */
os_write_packet(sdata->fd_out, out_buf, ob_free);
@@ -578,7 +589,9 @@
enc->frame_rate_base=FFMPEG_FRAME_RATE_BASE;
enc->max_qdiff=3;
-enc->aspect_ratio=0.0; /* guess assuming square pixels */
+//enc->aspect_ratio=0.0; /* guess assuming square pixels */
+enc->sample_aspect_ratio.num=0;
+enc->sample_aspect_ratio.den=0;
enc->me_method=ME_FULL;
enc->qblur=0.5;
enc->qcompress=0.5;
@@ -826,7 +839,7 @@
sdata->format_context.pb.write_flag=1;
sdata->format_context.pb.max_packet_size=0;
sdata->format_context.oformat->flags=AVFMT_NOFILE;
- sdata->format_context.flags=AVFMT_NOFILE;
+ sdata->format_context.ctx_flags=0; //AVFMTCTX_NOHEADER;
strcpy(sdata->format_context.title, arg_filename);
/* no way to extract these from TV signal */
sdata->format_context.title[0]=0;