* updated kmousetool (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / multimedia / avview / ffmpeg-compat.patch
blobb4275ea0b77f2de0a6480854430f2344bd957b91
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../avview/ffmpeg-compat.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
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
14 # version.
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
18 @@ -144,6 +144,7 @@
19 PACKET *f;
20 V4L_DATA *data;
21 AVFrame picture;
22 +AVPacket packet;
23 char *output_buf;
24 long ob_size, ob_free, ob_written;
25 long frames=0;
26 @@ -193,8 +194,12 @@
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));
31 i=ob_free-ob_written;
32 + packet.stream_index = sdata->video_stream_num;
33 + packet.data = output_buf + ob_written;
34 + packet.size = i;
35 + packet.pts = make_pts(start_ts, f->timestamp);
36 + packet.duration = 0;
37 } else {
38 i=write(sdata->fd_out, output_buf+ob_written, ob_free-ob_written);
40 @@ -301,6 +306,7 @@
41 int64 start_ts;
42 long ob_size, ob_free;
43 PACKET *f;
44 +AVPacket packet;
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());
48 @@ -324,7 +330,12 @@
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);
59 } else {
60 /* write using os function */
61 os_write_packet(sdata->fd_out, out_buf, ob_free);
62 @@ -578,7 +589,9 @@
64 enc->frame_rate_base=FFMPEG_FRAME_RATE_BASE;
65 enc->max_qdiff=3;
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;
71 enc->qblur=0.5;
72 enc->qcompress=0.5;
73 @@ -826,7 +839,7 @@
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;