OSDN Git Service

Changed download path for contrib libraries from http://multics.dynalias.com/handbrak...
[handbrake-jp/handbrake-jp-git.git] / contrib / patch-ffmpeg.patch
1 --- ffmpeg/configure    2006-09-23 14:22:08.000000000 -0400
2 +++ ffmpeg-patched/configure    2006-09-23 14:37:49.000000000 -0400
3 @@ -493,7 +493,7 @@
4  2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
5  mmx="no"
6  ;;
7 -*20010315*) echo "BeBits gcc"
8 +*20010315*|2.95.3*) echo "BeBits gcc"
9  add_cflags "-fno-expensive-optimizations"
10  ;;
11  esac
12 --- ffmpeg/libavformat/movenc.c 2006-09-23 14:22:08.000000000 -0400
13 +++ ffmpeg-patched/libavformat/movenc.c 2006-09-23 14:49:42.000000000 -0400
14 @@ -34,6 +34,7 @@
15  #define MODE_PSP 3 // example working PSP command line:
16  // ffmpeg -i testinput.avi  -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4
17  #define MODE_3G2 4
18 +#define MODE_IPOD 5
19  
20  typedef struct MOVIentry {
21      unsigned int flags, size;
22 @@ -600,6 +601,18 @@
23      return tag;
24  }
25  
26 +static int mov_write_colr_tag(ByteIOContext *pb)
27 +{
28 +       put_be32( pb, 0x12 );
29 +       put_tag( pb, "colr" );
30 +       put_tag( pb, "nclc" );
31 +       put_be16( pb, 6 );
32 +       put_be16( pb, 1 );
33 +       put_be16( pb, 6 );
34 +       put_be32( pb, 0 );
35 +       return 0x12;
36 +}
37 +
38  static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track)
39  {
40      offset_t pos = url_ftell(pb);
41 @@ -649,8 +662,21 @@
42          mov_write_d263_tag(pb);
43      else if(track->enc->codec_id == CODEC_ID_SVQ3)
44          mov_write_svq3_tag(pb);
45 -    else if(track->enc->codec_id == CODEC_ID_H264)
46 -        mov_write_avcc_tag(pb, track);
47 +       else if(track->enc->codec_id == CODEC_ID_H264) {
48 +               mov_write_avcc_tag(pb, track);
49 +               if (track->mode == MODE_IPOD) {
50 +                       put_be32(pb, 0x1C); /* size ... reports as 28 in mp4box! */
51 +                       put_tag(pb, "uuid");
52 +                       put_be32(pb, 0x6B6840F2);
53 +                       put_be32(pb, 0x5F244FC5);
54 +                       put_be32(pb, 0xBA39A51B);
55 +                       put_be32(pb, 0xCF0323F3);
56 +                       put_be32(pb, 0x00000001);
57 +                       put_be32(pb, 0x0000039C); 
58 +               }
59 +       }
60 +
61 +       mov_write_colr_tag(pb);
62  
63      return updateSize (pb, pos);
64  }
65 @@ -903,6 +929,10 @@
66      /* Track width and height, for visual only */
67      if(track->enc->codec_type == CODEC_TYPE_VIDEO) {
68          double sample_aspect_ratio = av_q2d(track->enc->sample_aspect_ratio);
69 +               if (track->mode == MODE_IPOD) {
70 +                       /* FIXME , I do not believe this is needed, bad assumption */
71 +                       sample_aspect_ratio = 1;
72 +               }
73          if( !sample_aspect_ratio ) sample_aspect_ratio = 1;
74          put_be32(pb, sample_aspect_ratio * track->enc->width*0x10000);
75          put_be32(pb, track->enc->height*0x10000);
76 @@ -1348,6 +1378,8 @@
77          put_tag(pb, "MSNV");
78      else if ( mov->mode == MODE_MP4 )
79          put_tag(pb, "isom");
80 +       else if ( mov->mode == MODE_IPOD )
81 +        put_tag(pb, "isom");
82      else
83          put_tag(pb, "qt  ");
84  
85 @@ -1359,6 +1391,8 @@
86          put_tag(pb, "3g2a");
87      else if ( mov->mode == MODE_PSP )
88          put_tag(pb, "MSNV");
89 +       else if ( mov->mode == MODE_IPOD )
90 +        put_tag(pb, "mp41");
91      else if ( mov->mode == MODE_MP4 )
92          put_tag(pb, "mp41");
93      else
94 @@ -1440,7 +1474,8 @@
95          else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3G2;
96          else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
97          else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
98 -
99 +               else if (!strcmp("ipod", s->oformat->name)) mov->mode = MODE_IPOD;
100 +               
101          mov_write_ftyp_tag(pb,s);
102          if ( mov->mode == MODE_PSP ) {
103              if ( s->nb_streams != 2 ) {
104 @@ -1640,6 +1675,21 @@
105      .flags = AVFMT_GLOBALHEADER,
106  };
107  #endif
108 +#ifdef CONFIG_IPOD_MUXER
109 +AVOutputFormat ipod_muxer = {
110 +    "ipod",
111 +    "ipod mp4 format",
112 +    "application/mp4",
113 +    "mp4,m4v,ipod",
114 +    sizeof(MOVContext),
115 +    CODEC_ID_AAC,
116 +    CODEC_ID_MPEG4,
117 +    mov_write_header,
118 +    mov_write_packet,
119 +    mov_write_trailer,
120 +    .flags = AVFMT_GLOBALHEADER,
121 +};
122 +#endif
123  #ifdef CONFIG_PSP_MUXER
124  AVOutputFormat psp_muxer = {
125      "psp",
126 --- ffmpeg/libavformat/tcp.c    2006-09-23 14:22:08.000000000 -0400
127 +++ ffmpeg-patched/libavformat/tcp.c    2006-09-23 14:34:32.000000000 -0400
128 @@ -112,11 +112,13 @@
129                  break;
130          }
131  
132 +#ifndef __BEOS__
133          /* test error */
134          optlen = sizeof(ret);
135          getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
136          if (ret != 0)
137              goto fail;
138 +#endif
139      }
140      s->fd = fd;
141      return 0;
142 --- ffmpeg/libavformat/allformats.h     2006-09-23 14:22:08.000000000 -0400
143 +++ ffmpeg-patched/libavformat/allformats.h     2006-09-23 15:02:41.000000000 -0400
144 @@ -74,6 +74,7 @@
145  extern AVOutputFormat mov_muxer;
146  extern AVOutputFormat tgp_muxer;
147  extern AVOutputFormat mp4_muxer;
148 +extern AVOutputFormat ipod_muxer;
149  extern AVOutputFormat psp_muxer;
150  extern AVOutputFormat tg2_muxer;
151  extern AVInputFormat mp3_demuxer;
152 --- ffmpeg/libavformat/allformats.c     2006-09-23 14:22:08.000000000 -0400
153 +++ ffmpeg-patched/libavformat/allformats.c     2006-09-23 14:26:11.000000000 -0400
154 @@ -204,6 +204,9 @@
155  #ifdef CONFIG_PSP_MUXER
156      av_register_output_format(&psp_muxer);
157  #endif
158 +#ifdef CONFIG_IPOD_MUXER
159 +    av_register_output_format(&ipod_muxer);
160 +#endif
161  #ifdef CONFIG_TG2_MUXER
162      av_register_output_format(&tg2_muxer);
163  #endif
164 --- ffmpeg/libavformat/Makefile 2006-09-23 14:22:08.000000000 -0400
165 +++ ffmpeg-patched/libavformat/Makefile 2006-09-23 20:15:09.000000000 -0400
166 @@ -62,6 +62,7 @@
167  OBJS-$(CONFIG_TGP_MUXER)                 += movenc.o riff.o isom.o
168  OBJS-$(CONFIG_MP4_MUXER)                 += movenc.o riff.o isom.o
169  OBJS-$(CONFIG_PSP_MUXER)                 += movenc.o riff.o isom.o
170 +OBJS-$(CONFIG_IPOD_MUXER)                 += movenc.o riff.o isom.o
171  OBJS-$(CONFIG_TG2_MUXER)                 += movenc.o riff.o isom.o
172  OBJS-$(CONFIG_MP3_DEMUXER)               += mp3.o
173  OBJS-$(CONFIG_MP2_MUXER)                 += mp3.o