1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../avview/ffmpeg-compat.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
16 --- avview-0.80.6/ffmpeg.c 2004-12-17 13:48:41.000000000 +0100
17 +++ avview-0.80.6.work/ffmpeg.c 2005-03-16 13:46:04.000000000 +0100
24 long ob_size, ob_free, ob_written;
27 while(ob_written<ob_free){
28 pthread_mutex_lock(&(sdata->format_context_mutex));
29 if(sdata->format_context.oformat!=NULL){
30 - 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));
32 + packet.stream_index = sdata->video_stream_num;
33 + packet.data = output_buf + ob_written;
35 + packet.pts = make_pts(start_ts, f->timestamp);
36 + packet.duration = 0;
38 i=write(sdata->fd_out, output_buf+ob_written, ob_free-ob_written);
42 long ob_size, ob_free;
45 ob_size=sdata->audio_codec_context.frame_size*sdata->audio_codec_context.channels*sizeof(short);
46 out_buf=do_alloc(ob_size, 1);
47 fprintf(stderr,"audio_encoding pid %d\n", getpid());
49 /* write output buffer */
50 if(sdata->format_context.oformat!=NULL){
51 /* write using libavcodec format output */
52 - sdata->format_context.oformat->write_packet(&(sdata->format_context),sdata->audio_stream_num, out_buf, ob_free, make_pts(start_ts, f->timestamp));
53 + packet.stream_index = sdata->video_stream_num;
54 + packet.data = out_buf;
55 + packet.size = ob_free;
56 + packet.pts = make_pts(start_ts, f->timestamp);
57 + packet.duration = 0;
58 + sdata->format_context.oformat->write_packet(&(sdata->format_context), &packet);
60 /* write using os function */
61 os_write_packet(sdata->fd_out, out_buf, ob_free);
64 enc->frame_rate_base=FFMPEG_FRAME_RATE_BASE;
66 -enc->aspect_ratio=0.0; /* guess assuming square pixels */
67 +//enc->aspect_ratio=0.0; /* guess assuming square pixels */
68 +enc->sample_aspect_ratio.num=0;
69 +enc->sample_aspect_ratio.den=0;
70 enc->me_method=ME_FULL;
74 sdata->format_context.pb.write_flag=1;
75 sdata->format_context.pb.max_packet_size=0;
76 sdata->format_context.oformat->flags=AVFMT_NOFILE;
77 - sdata->format_context.flags=AVFMT_NOFILE;
78 + sdata->format_context.ctx_flags=0; //AVFMTCTX_NOHEADER;
79 strcpy(sdata->format_context.title, arg_filename);
80 /* no way to extract these from TV signal */
81 sdata->format_context.title[0]=0;