History

Merge remote-tracking branch 'qatar/master'

* qatar/master: presets: rename presets directory lavc: make avcodec_get_context_defaults3 "officially" public lavf: replace av_new_stream->avformat_new_stream part II. lavf,lavd: replace av_new_stream->avformat_new_stream part I. lavf: add avformat_new_stream as a replacement for av_new_stream. Use correct scaling table for bwd-pred MVs in second B-field Ut Video decoder Makefile: change presets extension to .avpreset lavfi: add rgbtestsrc source, ported from MPlayer libmpcodecs lavfi: add testsrc source AVOptions: add documentation. presets: update libx264 ffpresets Conflicts: Changelog doc/APIchanges doc/ffmpeg.texi ffpresets/libx264-ipod320.ffpreset ffpresets/libx264-ipod640.ffpreset ffserver.c libavcodec/avcodec.h libavcodec/options.c libavcodec/version.h libavdevice/libdc1394.c libavfilter/avfilter.h libavfilter/vsrc_testsrc.c libavformat/flvdec.c libavformat/riff.c libavformat/version.h libavformat/wtv.c

Michael Niedermayer committed 15 years ago

Commit d0492572 parents 9ef7143 8096fdf181 files · +1021 −256Browse files

Unified · Split

181 files
  1. Changelog +1 −0
  2. Makefile +1 −1
  3. avconv.c +4 −1
  4. doc/APIchanges +3 −0
  5. doc/avconv.texi +1 −1
  6. doc/examples/muxing.c +1 −1
  7. doc/ffmpeg.texi +1 −1
  8. doc/general.texi +1 −0
  9. ffmpeg.c +4 −1
  10. ffpresets/libx264-ipod320.ffpreset +0 −8
  11. ffpresets/libx264-ipod640.ffpreset +0 −9
  12. ffserver.c +1 −0
  13. libavcodec/Makefile +1 −0
  14. libavcodec/allcodecs.c +1 −0
  15. libavcodec/avcodec.h +15 −2
  16. libavcodec/options.c +25 −23
  17. libavcodec/utvideo.c +460 −0
  18. libavcodec/vc1dec.c +11 −9
  19. libavcodec/version.h +1 −1
  20. libavdevice/alsa-audio-dec.c +1 −1
  21. libavdevice/bktr.c +1 −1
  22. libavdevice/fbdev.c +1 −1
  23. libavdevice/jack_audio.c +1 −1
  24. libavdevice/libcdio.c +1 −1
  25. libavdevice/libdc1394.c +1 −1
  26. libavdevice/oss_audio.c +1 −1
  27. libavdevice/sndio_dec.c +1 −1
  28. libavdevice/v4l.c +1 −1
  29. libavdevice/v4l2.c +1 −1
  30. libavdevice/vfwcap.c +1 −1
  31. libavdevice/x11grab.c +1 −1
  32. libavfilter/avfilter.h +1 −1
  33. libavfilter/vsrc_testsrc.c +7 −7
  34. libavformat/4xm.c +3 −2
  35. libavformat/aacdec.c +1 −1
  36. libavformat/aea.c +1 −1
  37. libavformat/aiffdec.c +1 −1
  38. libavformat/amr.c +1 −1
  39. libavformat/anm.c +1 −1
  40. libavformat/apc.c +1 −1
  41. libavformat/ape.c +1 −1
  42. libavformat/applehttp.c +2 −1
  43. libavformat/asfdec.c +1 −1
  44. libavformat/assdec.c +1 −1
  45. libavformat/au.c +1 −1
  46. libavformat/avformat.h +21 −0
  47. libavformat/avidec.c +2 −1
  48. libavformat/avisynth.c +4 −2
  49. libavformat/avs.c +2 −2
  50. libavformat/bethsoftvid.c +2 −2
  51. libavformat/bfi.c +2 −2
  52. libavformat/bink.c +2 −2
  53. libavformat/c93.c +2 −2
  54. libavformat/cafdec.c +1 −1
  55. libavformat/cdg.c +1 −1
  56. libavformat/daud.c +1 −1
  57. libavformat/dfa.c +1 −1
  58. libavformat/dsicin.c +2 −2
  59. libavformat/dv.c +2 −2
  60. libavformat/dxa.c +2 −2
  61. libavformat/eacdata.c +1 −1
  62. libavformat/electronicarts.c +2 −2
  63. libavformat/ffmdec.c +1 −1
  64. libavformat/ffmetadec.c +1 −1
  65. libavformat/filmstripdec.c +1 −1
  66. libavformat/flacdec.c +1 −1
  67. libavformat/flic.c +2 −2
  68. libavformat/flvdec.c +2 −1
  69. libavformat/gxf.c +2 −1
  70. libavformat/idcin.c +2 −2
  71. libavformat/idroqdec.c +2 −2
  72. libavformat/iff.c +1 −1
  73. libavformat/img2.c +1 −1
  74. libavformat/ipmovie.c +2 −2
  75. libavformat/iss.c +1 −1
  76. libavformat/iv8.c +1 −1
  77. libavformat/ivfdec.c +1 −1
  78. libavformat/jvdec.c +2 −2
  79. libavformat/libnut.c +1 −1
  80. libavformat/lmlm4.c +2 −2
  81. libavformat/lxfdec.c +2 −2
  82. libavformat/matroskadec.c +2 −2
  83. libavformat/mm.c +2 −2
  84. libavformat/mmf.c +1 −1
  85. libavformat/mov.c +2 −1
  86. libavformat/mp3dec.c +1 −1
  87. libavformat/mpc.c +1 −1
  88. libavformat/mpc8.c +1 −1
  89. libavformat/mpeg.c +2 −1
  90. libavformat/mpegts.c +13 −7
  91. libavformat/msnwc_tcp.c +1 −1
  92. libavformat/mtv.c +4 −6
  93. libavformat/mvi.c +2 −2
  94. libavformat/mxfdec.c +2 −1
  95. libavformat/mxg.c +4 −6
  96. libavformat/ncdec.c +1 −1
  97. libavformat/nsvdec.c +4 −2
  98. libavformat/nutdec.c +1 −1
  99. libavformat/nuv.c +2 −2
  100. libavformat/oggdec.c +2 −1
  101. libavformat/oma.c +1 −1
  102. libavformat/psxstr.c +2 −2
  103. libavformat/pva.c +2 −2
  104. libavformat/qcp.c +1 −1
  105. libavformat/r3d.c +2 −2
  106. libavformat/rawdec.c +3 −3
  107. libavformat/rdt.c +2 −1
  108. libavformat/riff.c +2 −2
  109. libavformat/rl2.c +2 −2
  110. libavformat/rmdec.c +2 −2
  111. libavformat/rpl.c +2 −2
  112. libavformat/rsodec.c +1 −1
  113. libavformat/rtpenc_chain.c +1 −1
  114. libavformat/rtsp.c +2 −1
  115. libavformat/sapdec.c +4 −2
  116. libavformat/segafilm.c +2 −2
  117. libavformat/sierravmd.c +2 −2
  118. libavformat/siff.c +2 −2
  119. libavformat/smacker.c +2 −2
  120. libavformat/sol.c +1 −1
  121. libavformat/soxdec.c +1 −1
  122. libavformat/spdifdec.c +1 −1
  123. libavformat/srtdec.c +1 −1
  124. libavformat/swfdec.c +6 −3
  125. libavformat/thp.c +2 −2
  126. libavformat/tiertexseq.c +2 −2
  127. libavformat/tmv.c +2 −2
  128. libavformat/tta.c +1 −1
  129. libavformat/tty.c +1 −1
  130. libavformat/txd.c +1 −1
  131. libavformat/utils.c +11 −2
  132. libavformat/vc1test.c +1 −1
  133. libavformat/version.h +5 −2
  134. libavformat/vocdec.c +1 −1
  135. libavformat/vqf.c +1 −1
  136. libavformat/wav.c +2 −2
  137. libavformat/wc3movie.c +2 −2
  138. libavformat/westwood.c +3 −3
  139. libavformat/wtvdec.c +3 −2
  140. libavformat/wv.c +1 −1
  141. libavformat/xa.c +1 −1
  142. libavformat/xmv.c +2 −2
  143. libavformat/xwma.c +1 −1
  144. libavformat/yop.c +2 −2
  145. libavformat/yuv4mpeg.c +1 −1
  146. libavutil/opt.h +183 −0
  147. presets/libvpx-1080p.ffpreset +0 −0
  148. presets/libvpx-1080p50_60.ffpreset +0 −0
  149. presets/libvpx-360p.ffpreset +0 −0
  150. presets/libvpx-720p.ffpreset +0 −0
  151. presets/libvpx-720p50_60.ffpreset +0 −0
  152. presets/libx264-baseline.ffpreset +1 −0
  153. presets/libx264-fast.ffpreset +1 −0
  154. presets/libx264-fast_firstpass.ffpreset +2 −0
  155. presets/libx264-faster.ffpreset +1 −0
  156. presets/libx264-faster_firstpass.ffpreset +2 −0
  157. presets/libx264-ipod320.ffpreset +4 −0
  158. presets/libx264-ipod640.ffpreset +4 −0
  159. presets/libx264-lossless_fast.ffpreset +2 −0
  160. presets/libx264-lossless_max.ffpreset +2 −0
  161. presets/libx264-lossless_medium.ffpreset +2 −0
  162. presets/libx264-lossless_slow.ffpreset +2 −0
  163. presets/libx264-lossless_slower.ffpreset +2 −0
  164. presets/libx264-lossless_ultrafast.ffpreset +2 −0
  165. presets/libx264-main.ffpreset +1 −0
  166. presets/libx264-medium.ffpreset +1 −0
  167. presets/libx264-medium_firstpass.ffpreset +2 −0
  168. presets/libx264-placebo.ffpreset +1 −0
  169. presets/libx264-placebo_firstpass.ffpreset +2 −0
  170. presets/libx264-slow.ffpreset +1 −0
  171. presets/libx264-slow_firstpass.ffpreset +2 −0
  172. presets/libx264-slower.ffpreset +1 −0
  173. presets/libx264-slower_firstpass.ffpreset +2 −0
  174. presets/libx264-superfast.ffpreset +1 −0
  175. presets/libx264-superfast_firstpass.ffpreset +2 −0
  176. presets/libx264-ultrafast.ffpreset +1 −0
  177. presets/libx264-ultrafast_firstpass.ffpreset +2 −0
  178. presets/libx264-veryfast.ffpreset +1 −0
  179. presets/libx264-veryfast_firstpass.ffpreset +2 −0
  180. presets/libx264-veryslow.ffpreset +1 −0
  181. presets/libx264-veryslow_firstpass.ffpreset +2 −0
Changelog+1−0
@@ -65,6 +65,7 @@ easier to use. The changes are: · 64 unmodified lines
6565 - VC-1 interlaced decoding
6666 - libutvideo wrapper (--enable-libutvideo)
6767 - aevalsrc audio source added
68+- Ut Video decoder
6869
6970
7071 version 0.8:
Makefile+1−1
@@ -38,7 +38,7 @@ FFLIBS-$(CONFIG_SWSCALE) += swscale · 37 unmodified lines
3838
3939 FFLIBS := avutil
4040
41−DATA_FILES := $(wildcard $(SRC_PATH)/ffpresets/*.ffpreset)
41+DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset)
4242
4343 SKIPHEADERS = cmdutils_common_opts.h
4444
avconv.c+4−1
@@ -3137,7 +3137,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV · 3136 unmodified lines
31373137 static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type)
31383138 {
31393139 OutputStream *ost;
3140− AVStream *st = av_new_stream(oc, oc->nb_streams < o->nb_streamid_map ? o->streamid_map[oc->nb_streams] : 0);
3140+ AVStream *st = avformat_new_stream(oc, NULL);
31413141 int idx = oc->nb_streams - 1, ret = 0;
31423142 int64_t max_frames = INT64_MAX;
31433143 char *bsf = NULL, *next, *codec_tag = NULL;
@@ -3151,6 +3151,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e · 7 unmodified lines
31513151 exit_program(1);
31523152 }
31533153
3154+ if (oc->nb_streams - 1 < o->nb_streamid_map)
3155+ st->id = o->streamid_map[oc->nb_streams - 1];
3156+
31543157 output_streams = grow_array(output_streams, sizeof(*output_streams), &nb_output_streams,
31553158 nb_output_streams + 1);
31563159 ost = &output_streams[nb_output_streams - 1];
doc/APIchanges+3−0
@@ -16,6 +16,9 @@ API changes, most recent first: · 15 unmodified lines
1616 2011-10-20 - b35e9e1 - lavu 51.22.0
1717 Add av_strtok() to avstring.h.
1818
19+2011-10-xx - xxxxxxx - lavf 53.10.0
20+ Add avformat_new_stream(). Deprecate av_new_stream().
21+
1922 2011-xx-xx - xxxxxxx - lavf 53.9.0
2023 Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
2124
doc/avconv.texi+1−1
@@ -778,7 +778,7 @@ A preset file contains a sequence of @var{option=value} pairs, one for · 777 unmodified lines
778778 each line, specifying a sequence of options which can be specified also on
779779 the command line. Lines starting with the hash ('#') character are ignored and
780780 are used to provide comments. Empty lines are also ignored. Check the
781−@file{ffpresets} directory in the Libav source tree for examples.
781+@file{presets} directory in the Libav source tree for examples.
782782
783783 Preset files are specified with the @code{pre} option, this option takes a
784784 preset name as input. Avconv searches for a file named @var{preset_name}.avpreset in
doc/examples/muxing.c+1−1
@@ -199,7 +199,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id) · 198 unmodified lines
199199 AVCodecContext *c;
200200 AVStream *st;
201201
202− st = av_new_stream(oc, 0);
202+ st = avformat_new_stream(oc, NULL);
203203 if (!st) {
204204 fprintf(stderr, "Could not alloc stream\n");
205205 exit(1);
doc/ffmpeg.texi+1−1
@@ -873,7 +873,7 @@ A preset file contains a sequence of @var{option}=@var{value} pairs, · 872 unmodified lines
873873 one for each line, specifying a sequence of options which would be
874874 awkward to specify on the command line. Lines starting with the hash
875875 ('#') character are ignored and are used to provide comments. Check
876−the @file{ffpresets} directory in the FFmpeg source tree for examples.
876+the @file{presets} directory in the FFmpeg source tree for examples.
877877
878878 Preset files are specified with the @code{vpre}, @code{apre},
879879 @code{spre}, and @code{fpre} options. The @code{fpre} option takes the
doc/general.texi+1−0
@@ -527,6 +527,7 @@ following image formats are supported: · 526 unmodified lines
527527 @tab encoding supported through external library libtheora
528528 @item Tiertex Limited SEQ video @tab @tab X
529529 @tab Codec used in DOS CD-ROM FlashBack game.
530+@item Ut Video @tab @tab X
530531 @item V210 Quicktime Uncompressed 4:2:2 10-bit @tab X @tab X
531532 @item VMware Screen Codec / VMware Video @tab @tab X
532533 @tab Codec used in videos captured by VMware.
ffmpeg.c+4−1
@@ -3252,7 +3252,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV · 3251 unmodified lines
32523252 static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type)
32533253 {
32543254 OutputStream *ost;
3255− AVStream *st = av_new_stream(oc, oc->nb_streams < o->nb_streamid_map ? o->streamid_map[oc->nb_streams] : 0);
3255+ AVStream *st = avformat_new_stream(oc, NULL);
32563256 int idx = oc->nb_streams - 1, ret = 0;
32573257 int64_t max_frames = INT64_MAX;
32583258 char *bsf = NULL, *next, *codec_tag = NULL;
@@ -3266,6 +3266,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e · 7 unmodified lines
32663266 exit_program(1);
32673267 }
32683268
3269+ if (oc->nb_streams - 1 < o->nb_streamid_map)
3270+ st->id = o->streamid_map[oc->nb_streams - 1];
3271+
32693272 output_streams = grow_array(output_streams, sizeof(*output_streams), &nb_output_streams,
32703273 nb_output_streams + 1);
32713274 ost = &output_streams[nb_output_streams - 1];
ffpresets/libx264-ipod320.ffpreset+0−8
@@ -1,8 +0,0 @@
1−coder=0
2−bf=0
3−weightb=0
4−8x8dct=0
5−level=13
6−maxrate=768000
7−bufsize=3000000
8−weightp=0
ffpresets/libx264-ipod640.ffpreset+0−9
@@ -1,9 +0,0 @@
1−coder=0
2−bf=0
3−refs=1
4−weightb=0
5−8x8dct=0
6−level=30
7−maxrate=10000000
8−bufsize=10000000
9−weightp=0
ffserver.c+1−0
@@ -4236,6 +4236,7 @@ static int parse_ffconfig(const char *filename) · 4235 unmodified lines
42364236 stream->fmt = ffserver_guess_format(NULL, stream->filename, NULL);
42374237 avcodec_get_context_defaults2(&video_enc, AVMEDIA_TYPE_VIDEO);
42384238 avcodec_get_context_defaults2(&audio_enc, AVMEDIA_TYPE_AUDIO);
4239+
42394240 audio_id = CODEC_ID_NONE;
42404241 video_id = CODEC_ID_NONE;
42414242 if (stream->fmt) {
libavcodec/Makefile+1−0
@@ -401,6 +401,7 @@ OBJS-$(CONFIG_TTA_DECODER) += tta.o · 400 unmodified lines
401401 OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o celp_math.o
402402 OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
403403 OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
404+OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideo.o
404405 OBJS-$(CONFIG_V210_DECODER) += v210dec.o
405406 OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
406407 OBJS-$(CONFIG_V210X_DECODER) += v210x.o
libavcodec/allcodecs.c+1−0
@@ -208,6 +208,7 @@ void avcodec_register_all(void) · 207 unmodified lines
208208 REGISTER_DECODER (TSCC, tscc);
209209 REGISTER_DECODER (TXD, txd);
210210 REGISTER_DECODER (ULTI, ulti);
211+ REGISTER_DECODER (UTVIDEO, utvideo);
211212 REGISTER_ENCDEC (V210, v210);
212213 REGISTER_DECODER (V210X, v210x);
213214 REGISTER_DECODER (VB, vb);
libavcodec/avcodec.h+15−2
@@ -212,6 +212,7 @@ enum CodecID { · 211 unmodified lines
212212 CODEC_ID_VC1IMAGE,
213213 CODEC_ID_8SVX_RAW,
214214 CODEC_ID_G2M,
215+ CODEC_ID_UTVIDEO_DEPRECATED,
215216 CODEC_ID_UTVIDEO = 0x800,
216217
217218 /* various PCM "codecs" */
@@ -3707,19 +3708,31 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); · 3489 unmodified lines
37073708 */
37083709 const char *av_get_profile_name(const AVCodec *codec, int profile);
37093710
3711+#if FF_API_ALLOC_CONTEXT
37103712 /**
37113713 * Set the fields of the given AVCodecContext to default values.
37123714 *
37133715 * @param s The AVCodecContext of which the fields should be set to default values.
3716+ * @deprecated use avcodec_get_context_defaults3
37143717 */
3718+attribute_deprecated
37153719 void avcodec_get_context_defaults(AVCodecContext *s);
37163720
37173721 /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
37183722 * we WILL change its arguments and name a few times! */
3723+attribute_deprecated
37193724 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
3725+#endif
37203726
3721−/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
3722− * we WILL change its arguments and name a few times! */
3727+/**
3728+ * Set the fields of the given AVCodecContext to default values corresponding
3729+ * to the given codec (defaults may be codec-dependent).
3730+ *
3731+ * Do not call this function if a non-NULL codec has been passed
3732+ * to avcodec_alloc_context3() that allocated this AVCodecContext.
3733+ * If codec is non-NULL, it is illegal to call avcodec_open2() with a
3734+ * different codec on this AVCodecContext.
3735+ */
37233736 int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
37243737
37253738 #if FF_API_ALLOC_CONTEXT
libavcodec/options.c+25−23
@@ -532,37 +532,41 @@ static const AVClass av_codec_context_class = { · 531 unmodified lines
532532 .child_class_next = codec_child_class_next,
533533 };
534534
535+#if FF_API_ALLOC_CONTEXT
535536 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
537+ AVCodec c= {0};
538+ c.type= codec_type;
539+ avcodec_get_context_defaults3(s, &c);
540+}
541+#endif
542+
543+int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
536544 int flags=0;
537545 memset(s, 0, sizeof(AVCodecContext));
538546
539− s->av_class= &av_codec_context_class;
547+ s->av_class = &av_codec_context_class;
540548
541− s->codec_type = codec_type;
542− if(codec_type == AVMEDIA_TYPE_AUDIO)
549+ s->codec_type = codec ? codec->type : AVMEDIA_TYPE_UNKNOWN;
550+ if(s->codec_type == AVMEDIA_TYPE_AUDIO)
543551 flags= AV_OPT_FLAG_AUDIO_PARAM;
544− else if(codec_type == AVMEDIA_TYPE_VIDEO)
552+ else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
545553 flags= AV_OPT_FLAG_VIDEO_PARAM;
546− else if(codec_type == AVMEDIA_TYPE_SUBTITLE)
554+ else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
547555 flags= AV_OPT_FLAG_SUBTITLE_PARAM;
548556 av_opt_set_defaults2(s, flags, flags);
549557
550− s->time_base= (AVRational){0,1};
551− s->get_buffer= avcodec_default_get_buffer;
552− s->release_buffer= avcodec_default_release_buffer;
553− s->get_format= avcodec_default_get_format;
554− s->execute= avcodec_default_execute;
555− s->execute2= avcodec_default_execute2;
556− s->sample_aspect_ratio= (AVRational){0,1};
557− s->pix_fmt= PIX_FMT_NONE;
558− s->sample_fmt= AV_SAMPLE_FMT_NONE;
559−
560− s->reget_buffer= avcodec_default_reget_buffer;
561− s->reordered_opaque= AV_NOPTS_VALUE;
562−}
563−
564−int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
565− avcodec_get_context_defaults2(s, codec ? codec->type : AVMEDIA_TYPE_UNKNOWN);
558+ s->time_base = (AVRational){0,1};
559+ s->get_buffer = avcodec_default_get_buffer;
560+ s->release_buffer = avcodec_default_release_buffer;
561+ s->get_format = avcodec_default_get_format;
562+ s->execute = avcodec_default_execute;
563+ s->execute2 = avcodec_default_execute2;
564+ s->sample_aspect_ratio = (AVRational){0,1};
565+ s->pix_fmt = PIX_FMT_NONE;
566+ s->sample_fmt = AV_SAMPLE_FMT_NONE;
567+
568+ s->reget_buffer = avcodec_default_reget_buffer;
569+ s->reordered_opaque = AV_NOPTS_VALUE;
566570 if(codec && codec->priv_data_size){
567571 if(!s->priv_data){
568572 s->priv_data= av_mallocz(codec->priv_data_size);
@@ -610,13 +614,11 @@ AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){ · 41 unmodified lines
610614
611615 return avctx;
612616 }
613−#endif
614617
615618 void avcodec_get_context_defaults(AVCodecContext *s){
616619 avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN);
617620 }
618621
619−#if FF_API_ALLOC_CONTEXT
620622 AVCodecContext *avcodec_alloc_context(void){
621623 return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN);
622624 }
libavcodec/utvideo.c+460−0
@@ -0,0 +1,460 @@
1+/*
2+ * Ut Video decoder
3+ * Copyright (c) 2011 Konstantin Shishkov
4+ *
5+ * This file is part of Libav.
6+ *
7+ * Libav is free software; you can redistribute it and/or
8+ * modify it under the terms of the GNU Lesser General Public
9+ * License as published by the Free Software Foundation; either
10+ * version 2.1 of the License, or (at your option) any later version.
11+ *
12+ * Libav is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+ * Lesser General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU Lesser General Public
18+ * License along with Libav; if not, write to the Free Software
19+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+ */
21+
22+/**
23+ * @file
24+ * Ut Video decoder
25+ */
26+
27+#include <stdlib.h>
28+
29+#include "libavutil/intreadwrite.h"
30+#include "avcodec.h"
31+#include "bytestream.h"
32+#include "get_bits.h"
33+#include "dsputil.h"
34+
35+enum {
36+ PRED_NONE = 0,
37+ PRED_LEFT,
38+ PRED_GRADIENT,
39+ PRED_MEDIAN,
40+};
41+
42+typedef struct UtvideoContext {
43+ AVCodecContext *avctx;
44+ AVFrame pic;
45+ DSPContext dsp;
46+
47+ uint32_t frame_info_size, flags, frame_info;
48+ int planes;
49+ int slices;
50+ int compression;
51+ int interlaced;
52+ int frame_pred;
53+
54+ uint8_t *slice_bits;
55+ int slice_bits_size;
56+} UtvideoContext;
57+
58+typedef struct HuffEntry {
59+ uint8_t sym;
60+ uint8_t len;
61+} HuffEntry;
62+
63+static int huff_cmp(const void *a, const void *b)
64+{
65+ const HuffEntry *aa = a, *bb = b;
66+ return (aa->len - bb->len)*256 + aa->sym - bb->sym;
67+}
68+
69+static int build_huff(const uint8_t *src, VLC *vlc)
70+{
71+ int i;
72+ HuffEntry he[256];
73+ int last;
74+ uint32_t codes[256];
75+ uint8_t bits[256];
76+ uint8_t syms[256];
77+ uint32_t code;
78+
79+ for (i = 0; i < 256; i++) {
80+ he[i].sym = i;
81+ he[i].len = *src++;
82+ }
83+ qsort(he, 256, sizeof(*he), huff_cmp);
84+
85+ if (!he[0].len || he[0].len > 32)
86+ return -1;
87+
88+ last = 255;
89+ while (he[last].len == 255 && last)
90+ last--;
91+
92+ code = 1;
93+ for (i = last; i >= 0; i--) {
94+ codes[i] = code >> (32 - he[i].len);
95+ bits[i] = he[i].len;
96+ syms[i] = he[i].sym;
97+ code += 0x80000000u >> (he[i].len - 1);
98+ }
99+
100+ return init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,
101+ bits, sizeof(*bits), sizeof(*bits),
102+ codes, sizeof(*codes), sizeof(*codes),
103+ syms, sizeof(*syms), sizeof(*syms), 0);
104+}
105+
106+static int decode_plane(UtvideoContext *c, int plane_no,
107+ uint8_t *dst, int step, int stride,
108+ int width, int height,
109+ const uint8_t *src, int src_size, int use_pred)
110+{
111+ int i, j, slice, pix;
112+ int sstart, send;
113+ VLC vlc;
114+ GetBitContext gb;
115+ int prev;
116+
117+ if (build_huff(src, &vlc)) {
118+ av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
119+ return AVERROR_INVALIDDATA;
120+ }
121+
122+ src += 256;
123+ src_size -= 256;
124+
125+ send = 0;
126+ for (slice = 0; slice < c->slices; slice++) {
127+ uint8_t *dest;
128+ int slice_data_start, slice_data_end, slice_size;
129+
130+ sstart = send;
131+ send = height * (slice + 1) / c->slices;
132+ dest = dst + sstart * stride;
133+
134+ // slice offset and size validation was done earlier
135+ slice_data_start = slice ? AV_RL32(src + slice * 4 - 4) : 0;
136+ slice_data_end = AV_RL32(src + slice * 4);
137+ slice_size = slice_data_end - slice_data_start;
138+
139+ if (!slice_size) {
140+ for (j = sstart; j < send; j++) {
141+ for (i = 0; i < width * step; i += step)
142+ dest[i] = 0x80;
143+ dest += stride;
144+ }
145+ continue;
146+ }
147+
148+ memcpy(c->slice_bits, src + slice_data_start + c->slices * 4, slice_size);
149+ memset(c->slice_bits + slice_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
150+ c->dsp.bswap_buf((uint32_t*)c->slice_bits, (uint32_t*)c->slice_bits,
151+ (slice_data_end - slice_data_start + 3) >> 2);
152+ init_get_bits(&gb, c->slice_bits, slice_size * 8);
153+
154+ prev = 0x80;
155+ for (j = sstart; j < send; j++) {
156+ for (i = 0; i < width * step; i += step) {
157+ if (get_bits_left(&gb) <= 0) {
158+ av_log(c->avctx, AV_LOG_ERROR, "Slice decoding ran out of bits\n");
159+ goto fail;
160+ }
161+ pix = get_vlc2(&gb, vlc.table, vlc.bits, 4);
162+ if (pix < 0) {
163+ av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
164+ goto fail;
165+ }
166+ if (use_pred) {
167+ prev += pix;
168+ pix = prev;
169+ }
170+ dest[i] = pix;
171+ }
172+ dest += stride;
173+ }
174+ if (get_bits_left(&gb) > 32)
175+ av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n",
176+ get_bits_left(&gb));
177+ }
178+
179+ free_vlc(&vlc);
180+
181+ return 0;
182+fail:
183+ free_vlc(&vlc);
184+ return AVERROR_INVALIDDATA;
185+}
186+
187+static const int rgb_order[4] = { 1, 2, 0, 3 };
188+
189+static void restore_rgb_planes(uint8_t *src, int step, int stride, int width, int height)
190+{
191+ int i, j;
192+ uint8_t r, g, b;
193+
194+ for (j = 0; j < height; j++) {
195+ for (i = 0; i < width * step; i += step) {
196+ r = src[i];
197+ g = src[i + 1];
198+ b = src[i + 2];
199+ src[i] = r + g - 0x80;
200+ src[i + 2] = b + g - 0x80;
201+ }
202+ src += stride;
203+ }
204+}
205+
206+static void restore_median(uint8_t *src, int step, int stride,
207+ int width, int height, int slices)
208+{
209+ int i, j, slice;
210+ int A, B, C;
211+ uint8_t *bsrc;
212+ int slice_start, slice_height;
213+
214+ for (slice = 0; slice < slices; slice++) {
215+ slice_start = (slice * height) / slices;
216+ slice_height = ((slice + 1) * height) / slices - slice_start;
217+
218+ bsrc = src + slice_start * stride;
219+
220+ // first line - left neighbour prediction
221+ bsrc[0] += 0x80;
222+ A = bsrc[0];
223+ for (i = step; i < width * step; i += step) {
224+ bsrc[i] += A;
225+ A = bsrc[i];
226+ }
227+ bsrc += stride;
228+ if (slice_height == 1)
229+ continue;
230+ // second line - first element has top predition, the rest uses median
231+ C = bsrc[-stride];
232+ bsrc[0] += C;
233+ A = bsrc[0];
234+ for (i = step; i < width * step; i += step) {
235+ B = bsrc[i - stride];
236+ bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
237+ C = B;
238+ A = bsrc[i];
239+ }
240+ bsrc += stride;
241+ // the rest of lines use continuous median prediction
242+ for (j = 2; j < slice_height; j++) {
243+ for (i = 0; i < width * step; i += step) {
244+ B = bsrc[i - stride];
245+ bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
246+ C = B;
247+ A = bsrc[i];
248+ }
249+ bsrc += stride;
250+ }
251+ }
252+}
253+
254+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
255+{
256+ const uint8_t *buf = avpkt->data;
257+ int buf_size = avpkt->size;
258+ const uint8_t *buf_end = buf + buf_size;
259+ UtvideoContext *c = avctx->priv_data;
260+ const uint8_t *ptr;
261+ int i, j;
262+ const uint8_t *plane_start[5];
263+ int plane_size, max_slice_size = 0, slice_start, slice_end, slice_size;
264+ int ret;
265+
266+ if (c->pic.data[0])
267+ avctx->release_buffer(avctx, &c->pic);
268+
269+ c->pic.reference = 1;
270+ c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
271+ if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) {
272+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
273+ return ret;
274+ }
275+
276+ /* parse plane structure to retrieve frame flags and validate slice offsets */
277+ ptr = buf;
278+ for (i = 0; i < c->planes; i++) {
279+ plane_start[i] = ptr;
280+ if (buf_end - ptr < 256 + 4 * c->slices) {
281+ av_log(avctx, AV_LOG_ERROR, "Insufficient data for a plane\n");
282+ return AVERROR_INVALIDDATA;
283+ }
284+ ptr += 256;
285+ slice_start = 0;
286+ slice_end = 0;
287+ for (j = 0; j < c->slices; j++) {
288+ slice_end = bytestream_get_le32(&ptr);
289+ slice_size = slice_end - slice_start;
290+ if (slice_size < 0) {
291+ av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n");
292+ return AVERROR_INVALIDDATA;
293+ }
294+ slice_start = slice_end;
295+ max_slice_size = FFMAX(max_slice_size, slice_size);
296+ }
297+ plane_size = slice_end;
298+ if (buf_end - ptr < plane_size) {
299+ av_log(avctx, AV_LOG_ERROR, "Plane size is bigger than available data\n");
300+ return AVERROR_INVALIDDATA;
301+ }
302+ ptr += plane_size;
303+ }
304+ plane_start[c->planes] = ptr;
305+ if (buf_end - ptr < c->frame_info_size) {
306+ av_log(avctx, AV_LOG_ERROR, "Not enough data for frame information\n");
307+ return AVERROR_INVALIDDATA;
308+ }
309+ c->frame_info = AV_RL32(ptr);
310+ av_log(avctx, AV_LOG_DEBUG, "frame information flags %X\n", c->frame_info);
311+
312+ c->frame_pred = (c->frame_info >> 8) & 3;
313+
314+ if (c->frame_pred == PRED_GRADIENT) {
315+ av_log_ask_for_sample(avctx, "Frame uses gradient prediction\n");
316+ return AVERROR_PATCHWELCOME;
317+ }
318+
319+ av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
320+ max_slice_size + FF_INPUT_BUFFER_PADDING_SIZE);
321+
322+ if (!c->slice_bits) {
323+ av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
324+ return AVERROR(ENOMEM);
325+ }
326+
327+ switch (c->avctx->pix_fmt) {
328+ case PIX_FMT_RGB24:
329+ case PIX_FMT_RGBA:
330+ for (i = 0; i < c->planes; i++) {
331+ ret = decode_plane(c, i, c->pic.data[0] + rgb_order[i], c->planes,
332+ c->pic.linesize[0], avctx->width, avctx->height,
333+ plane_start[i], plane_start[i + 1] - plane_start[i],
334+ c->frame_pred == PRED_LEFT);
335+ if (ret)
336+ return ret;
337+ if (c->frame_pred == PRED_MEDIAN)
338+ restore_median(c->pic.data[0] + rgb_order[i], c->planes,
339+ c->pic.linesize[0], avctx->width, avctx->height,
340+ c->slices);
341+ }
342+ restore_rgb_planes(c->pic.data[0], c->planes, c->pic.linesize[0],
343+ avctx->width, avctx->height);
344+ break;
345+ case PIX_FMT_YUV420P:
346+ for (i = 0; i < 3; i++) {
347+ ret = decode_plane(c, i, c->pic.data[i], 1,
348+ c->pic.linesize[i], avctx->width >> !!i, avctx->height >> !!i,
349+ plane_start[i], plane_start[i + 1] - plane_start[i],
350+ c->frame_pred == PRED_LEFT);
351+ if (ret)
352+ return ret;
353+ if (c->frame_pred == PRED_MEDIAN)
354+ restore_median(c->pic.data[i], 1, c->pic.linesize[i],
355+ avctx->width >> !!i, avctx->height >> !!i,
356+ c->slices);
357+ }
358+ break;
359+ case PIX_FMT_YUV422P:
360+ for (i = 0; i < 3; i++) {
361+ ret = decode_plane(c, i, c->pic.data[i], 1,
362+ c->pic.linesize[i], avctx->width >> !!i, avctx->height,
363+ plane_start[i], plane_start[i + 1] - plane_start[i],
364+ c->frame_pred == PRED_LEFT);
365+ if (ret)
366+ return ret;
367+ if (c->frame_pred == PRED_MEDIAN)
368+ restore_median(c->pic.data[i], 1, c->pic.linesize[i],
369+ avctx->width >> !!i, avctx->height, c->slices);
370+ }
371+ break;
372+ }
373+
374+ *data_size = sizeof(AVFrame);
375+ *(AVFrame*)data = c->pic;
376+
377+ /* always report that the buffer was completely consumed */
378+ return buf_size;
379+}
380+
381+static av_cold int decode_init(AVCodecContext *avctx)
382+{
383+ UtvideoContext * const c = avctx->priv_data;
384+
385+ c->avctx = avctx;
386+
387+ dsputil_init(&c->dsp, avctx);
388+
389+ if (avctx->extradata_size < 16) {
390+ av_log(avctx, AV_LOG_ERROR, "Insufficient extradata size %d, should be at least 16\n",
391+ avctx->extradata_size);
392+ return AVERROR_INVALIDDATA;
393+ }
394+
395+ av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n",
396+ avctx->extradata[3], avctx->extradata[2],
397+ avctx->extradata[1], avctx->extradata[0]);
398+ av_log(avctx, AV_LOG_DEBUG, "Original format %X\n", AV_RB32(avctx->extradata + 4));
399+ c->frame_info_size = AV_RL32(avctx->extradata + 8);
400+ c->flags = AV_RL32(avctx->extradata + 12);
401+
402+ if (c->frame_info_size != 4)
403+ av_log_ask_for_sample(avctx, "Frame info is not 4 bytes\n");
404+ av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08X\n", c->flags);
405+ c->slices = (c->flags >> 24) + 1;
406+ c->compression = c->flags & 1;
407+ c->interlaced = c->flags & 0x800;
408+
409+ c->slice_bits_size = 0;
410+
411+ switch (avctx->codec_tag) {
412+ case MKTAG('U', 'L', 'R', 'G'):
413+ c->planes = 3;
414+ avctx->pix_fmt = PIX_FMT_RGB24;
415+ break;
416+ case MKTAG('U', 'L', 'R', 'A'):
417+ c->planes = 4;
418+ avctx->pix_fmt = PIX_FMT_RGBA;
419+ break;
420+ case MKTAG('U', 'L', 'Y', '0'):
421+ c->planes = 3;
422+ avctx->pix_fmt = PIX_FMT_YUV420P;
423+ break;
424+ case MKTAG('U', 'L', 'Y', '2'):
425+ c->planes = 3;
426+ avctx->pix_fmt = PIX_FMT_YUV422P;
427+ break;
428+ default:
429+ av_log(avctx, AV_LOG_ERROR, "Unknown Ut Video FOURCC provided (%08X)\n",
430+ avctx->codec_tag);
431+ return AVERROR_INVALIDDATA;
432+ }
433+
434+ return 0;
435+}
436+
437+static av_cold int decode_end(AVCodecContext *avctx)
438+{
439+ UtvideoContext * const c = avctx->priv_data;
440+
441+ if (c->pic.data[0])
442+ avctx->release_buffer(avctx, &c->pic);
443+
444+ av_freep(&c->slice_bits);
445+
446+ return 0;
447+}
448+
449+AVCodec ff_utvideo_decoder = {
450+ .name = "utvideo",
451+ .type = AVMEDIA_TYPE_VIDEO,
452+ .id = CODEC_ID_UTVIDEO,
453+ .priv_data_size = sizeof(UtvideoContext),
454+ .init = decode_init,
455+ .close = decode_end,
456+ .decode = decode_frame,
457+ .capabilities = CODEC_CAP_DR1,
458+ .long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
459+};
460+
libavcodec/vc1dec.c+11−9
@@ -1291,6 +1291,7 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di · 1290 unmodified lines
12911291 int scaledvalue, refdist;
12921292 int scalesame1, scalesame2;
12931293 int scalezone1_x, zone1offset_x;
1294+ int table_index = dir ^ v->second_field;
12941295
12951296 if (v->s.pict_type != AV_PICTURE_TYPE_B)
12961297 refdist = v->refdist;
@@ -1298,10 +1299,10 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di · 1 unmodified line
12981299 refdist = dir ? v->brfd : v->frfd;
12991300 if (refdist > 3)
13001301 refdist = 3;
1301− scalesame1 = vc1_field_mvpred_scales[v->second_field][1][refdist];
1302− scalesame2 = vc1_field_mvpred_scales[v->second_field][2][refdist];
1303− scalezone1_x = vc1_field_mvpred_scales[v->second_field][3][refdist];
1304− zone1offset_x = vc1_field_mvpred_scales[v->second_field][5][refdist];
1302+ scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist];
1303+ scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist];
1304+ scalezone1_x = vc1_field_mvpred_scales[table_index][3][refdist];
1305+ zone1offset_x = vc1_field_mvpred_scales[table_index][5][refdist];
13051306
13061307 if (FFABS(n) > 255)
13071308 scaledvalue = n;
@@ -1323,6 +1324,7 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, · 15 unmodified lines
13231324 int scaledvalue, refdist;
13241325 int scalesame1, scalesame2;
13251326 int scalezone1_y, zone1offset_y;
1327+ int table_index = dir ^ v->second_field;
13261328
13271329 if (v->s.pict_type != AV_PICTURE_TYPE_B)
13281330 refdist = v->refdist;
@@ -1330,10 +1332,10 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, · 1 unmodified line
13301332 refdist = dir ? v->brfd : v->frfd;
13311333 if (refdist > 3)
13321334 refdist = 3;
1333− scalesame1 = vc1_field_mvpred_scales[v->second_field][1][refdist];
1334− scalesame2 = vc1_field_mvpred_scales[v->second_field][2][refdist];
1335− scalezone1_y = vc1_field_mvpred_scales[v->second_field][4][refdist];
1336− zone1offset_y = vc1_field_mvpred_scales[v->second_field][6][refdist];
1335+ scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist];
1336+ scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist];
1337+ scalezone1_y = vc1_field_mvpred_scales[table_index][4][refdist];
1338+ zone1offset_y = vc1_field_mvpred_scales[table_index][6][refdist];
13371339
13381340 if (FFABS(n) > 63)
13391341 scaledvalue = n;
@@ -1444,7 +1446,7 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */, · 104 unmodified lines
14441446 refdist = FFMIN(v->refdist, 3);
14451447 else
14461448 refdist = dir ? v->brfd : v->frfd;
1447− scaleopp = vc1_field_mvpred_scales[v->second_field][0][refdist];
1449+ scaleopp = vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist];
14481450
14491451 return n * scaleopp >> 8;
14501452 }
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AVCODEC_VERSION_H
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 53
24−#define LIBAVCODEC_VERSION_MINOR 21
24+#define LIBAVCODEC_VERSION_MINOR 22
2525 #define LIBAVCODEC_VERSION_MICRO 0
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavdevice/alsa-audio-dec.c+1−1
@@ -61,7 +61,7 @@ static av_cold int audio_read_header(AVFormatContext *s1, · 60 unmodified lines
6161 enum CodecID codec_id;
6262 double o;
6363
64− st = av_new_stream(s1, 0);
64+ st = avformat_new_stream(s1, NULL);
6565 if (!st) {
6666 av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
6767
libavdevice/bktr.c+1−1
@@ -271,7 +271,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 270 unmodified lines
271271 goto out;
272272 }
273273
274− st = av_new_stream(s1, 0);
274+ st = avformat_new_stream(s1, NULL);
275275 if (!st) {
276276 ret = AVERROR(ENOMEM);
277277 goto out;
libavdevice/fbdev.c+1−1
@@ -108,7 +108,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 107 unmodified lines
108108 return ret;
109109 }
110110
111− if (!(st = av_new_stream(avctx, 0)))
111+ if (!(st = avformat_new_stream(avctx, NULL)))
112112 return AVERROR(ENOMEM);
113113 av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
114114
libavdevice/jack_audio.c+1−1
@@ -229,7 +229,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param · 228 unmodified lines
229229 if ((test = start_jack(context)))
230230 return test;
231231
232− stream = av_new_stream(context, 0);
232+ stream = avformat_new_stream(context, NULL);
233233 if (!stream) {
234234 stop_jack(self);
235235 return AVERROR(ENOMEM);
libavdevice/libcdio.c+1−1
@@ -54,7 +54,7 @@ static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap) · 53 unmodified lines
5454 int ret, i;
5555 char *err = NULL;
5656
57− if (!(st = av_new_stream(ctx, 0)))
57+ if (!(st = avformat_new_stream(ctx, NULL)))
5858 return AVERROR(ENOMEM);
5959 s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
6060 if (!s->drive) {
libavdevice/libdc1394.c+1−1
@@ -253,7 +253,7 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap) · 252 unmodified lines
253253 }
254254
255255 /* create a video stream */
256− vst = av_new_stream(c, 0);
256+ vst = avformat_new_stream(c, NULL);
257257 if (!vst)
258258 goto out_camera;
259259 av_set_pts_info(vst, 64, 1, 1000);
libavdevice/oss_audio.c+1−1
@@ -209,7 +209,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 208 unmodified lines
209209 AVStream *st;
210210 int ret;
211211
212− st = av_new_stream(s1, 0);
212+ st = avformat_new_stream(s1, NULL);
213213 if (!st) {
214214 return AVERROR(ENOMEM);
215215 }
libavdevice/sndio_dec.c+1−1
@@ -34,7 +34,7 @@ static av_cold int audio_read_header(AVFormatContext *s1, · 33 unmodified lines
3434 AVStream *st;
3535 int ret;
3636
37− st = av_new_stream(s1, 0);
37+ st = avformat_new_stream(s1, NULL);
3838 if (!st)
3939 return AVERROR(ENOMEM);
4040
libavdevice/v4l.c+1−1
@@ -98,7 +98,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 97 unmodified lines
9898 s->video_win.width = ap->width;
9999 s->video_win.height = ap->height;
100100
101− st = av_new_stream(s1, 0);
101+ st = avformat_new_stream(s1, NULL);
102102 if (!st)
103103 return AVERROR(ENOMEM);
104104 av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
libavdevice/v4l2.c+1−1
@@ -560,7 +560,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 559 unmodified lines
560560 enum CodecID codec_id;
561561 enum PixelFormat pix_fmt = PIX_FMT_NONE;
562562
563− st = av_new_stream(s1, 0);
563+ st = avformat_new_stream(s1, NULL);
564564 if (!st) {
565565 res = AVERROR(ENOMEM);
566566 goto out;
libavdevice/vfwcap.c+1−1
@@ -293,7 +293,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 292 unmodified lines
293293
294294 SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s);
295295
296− st = av_new_stream(s, 0);
296+ st = avformat_new_stream(s, NULL);
297297 if(!st) {
298298 vfw_read_close(s);
299299 return AVERROR(ENOMEM);
libavdevice/x11grab.c+1−1
@@ -194,7 +194,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 193 unmodified lines
194194 goto out;
195195 }
196196
197− st = av_new_stream(s1, 0);
197+ st = avformat_new_stream(s1, NULL);
198198 if (!st) {
199199 ret = AVERROR(ENOMEM);
200200 goto out;
libavfilter/avfilter.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVFILTER_VERSION_MAJOR 2
3232 #define LIBAVFILTER_VERSION_MINOR 44
33−#define LIBAVFILTER_VERSION_MICRO 0
33+#define LIBAVFILTER_VERSION_MICRO 1
3434
3535 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3636 LIBAVFILTER_VERSION_MINOR, \
libavfilter/vsrc_testsrc.c+7−7
@@ -103,7 +103,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 102 unmodified lines
103103 test->nb_frame = 0;
104104 test->pts = 0;
105105
106− av_log(ctx, AV_LOG_INFO, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
106+ av_log(ctx, AV_LOG_DEBUG, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
107107 test->w, test->h, frame_rate_q.num, frame_rate_q.den,
108108 duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
109109 test->sar.num, test->sar.den);
@@ -156,9 +156,9 @@ static const char *testsrc_get_name(void *ctx) · 46 unmodified lines
156156 }
157157
158158 static const AVClass testsrc_class = {
159− "TestSourceContext",
160− testsrc_get_name,
161− testsrc_options
159+ .class_name = "TestSourceContext",
160+ .item_name = testsrc_get_name,
161+ .option = testsrc_options,
162162 };
163163
164164 /**
@@ -378,9 +378,9 @@ static const char *rgbtestsrc_get_name(void *ctx) · 213 unmodified lines
378378 }
379379
380380 static const AVClass rgbtestsrc_class = {
381− "RGBTestSourceContext",
382− rgbtestsrc_get_name,
383− testsrc_options
381+ .class_name = "RGBTestSourceContext",
382+ .item_name = rgbtestsrc_get_name,
383+ .option = testsrc_options,
384384 };
385385
386386 #define R 0
libavformat/4xm.c+3−2
@@ -141,7 +141,7 @@ static int fourxm_read_header(AVFormatContext *s, · 140 unmodified lines
141141 fourxm->height = AV_RL32(&header[i + 40]);
142142
143143 /* allocate a new AVStream */
144− st = av_new_stream(s, 0);
144+ st = avformat_new_stream(s, NULL);
145145 if (!st){
146146 ret= AVERROR(ENOMEM);
147147 goto fail;
@@ -199,12 +199,13 @@ static int fourxm_read_header(AVFormatContext *s, · 51 unmodified lines
199199 i += 8 + size;
200200
201201 /* allocate a new AVStream */
202− st = av_new_stream(s, current_track);
202+ st = avformat_new_stream(s, NULL);
203203 if (!st){
204204 ret= AVERROR(ENOMEM);
205205 goto fail;
206206 }
207207
208+ st->id = current_track;
208209 av_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate);
209210
210211 fourxm->tracks[current_track].stream_index = st->index;
libavformat/aacdec.c+1−1
@@ -66,7 +66,7 @@ static int adts_aac_read_header(AVFormatContext *s, · 65 unmodified lines
6666 {
6767 AVStream *st;
6868
69− st = av_new_stream(s, 0);
69+ st = avformat_new_stream(s, NULL);
7070 if (!st)
7171 return AVERROR(ENOMEM);
7272
libavformat/aea.c+1−1
@@ -57,7 +57,7 @@ static int aea_read_probe(AVProbeData *p) · 56 unmodified lines
5757 static int aea_read_header(AVFormatContext *s,
5858 AVFormatParameters *ap)
5959 {
60− AVStream *st = av_new_stream(s, 0);
60+ AVStream *st = avformat_new_stream(s, NULL);
6161 if (!st)
6262 return AVERROR(ENOMEM);
6363
libavformat/aiffdec.c+1−1
@@ -198,7 +198,7 @@ static int aiff_read_header(AVFormatContext *s, · 197 unmodified lines
198198
199199 filesize -= 4;
200200
201− st = av_new_stream(s, 0);
201+ st = avformat_new_stream(s, NULL);
202202 if (!st)
203203 return AVERROR(ENOMEM);
204204
libavformat/amr.c+1−1
@@ -84,7 +84,7 @@ static int amr_read_header(AVFormatContext *s, · 83 unmodified lines
8484
8585 avio_read(pb, header, 6);
8686
87− st = av_new_stream(s, 0);
87+ st = avformat_new_stream(s, NULL);
8888 if (!st)
8989 {
9090 return AVERROR(ENOMEM);
libavformat/anm.c+1−1
@@ -97,7 +97,7 @@ static int read_header(AVFormatContext *s, · 96 unmodified lines
9797 return AVERROR_INVALIDDATA;
9898
9999 /* video stream */
100− st = av_new_stream(s, 0);
100+ st = avformat_new_stream(s, NULL);
101101 if (!st)
102102 return AVERROR(ENOMEM);
103103 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
libavformat/apc.c+1−1
@@ -39,7 +39,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) · 38 unmodified lines
3939 avio_rl32(pb); /* _APC */
4040 avio_rl32(pb); /* 1.20 */
4141
42− st = av_new_stream(s, 0);
42+ st = avformat_new_stream(s, NULL);
4343 if (!st)
4444 return AVERROR(ENOMEM);
4545
libavformat/ape.c+1−1
@@ -313,7 +313,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) · 312 unmodified lines
313313 ape->compressiontype);
314314
315315 /* now we are ready: build format streams */
316− st = av_new_stream(s, 0);
316+ st = avformat_new_stream(s, NULL);
317317 if (!st)
318318 return -1;
319319
libavformat/applehttp.c+2−1
@@ -505,11 +505,12 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap) · 504 unmodified lines
505505 snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
506506 /* Create new AVStreams for each stream in this variant */
507507 for (j = 0; j < v->ctx->nb_streams; j++) {
508− AVStream *st = av_new_stream(s, i);
508+ AVStream *st = avformat_new_stream(s, NULL);
509509 if (!st) {
510510 ret = AVERROR(ENOMEM);
511511 goto fail;
512512 }
513+ st->id = i;
513514 avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
514515 if (v->bandwidth)
515516 av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,
libavformat/asfdec.c+1−1
@@ -224,7 +224,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) · 223 unmodified lines
224224
225225 pos1 = avio_tell(pb);
226226
227− st = av_new_stream(s, 0);
227+ st = avformat_new_stream(s, NULL);
228228 if (!st)
229229 return AVERROR(ENOMEM);
230230 av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
libavformat/assdec.c+1−1
@@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 82 unmodified lines
8383 uint8_t *p, **dst[2]={0};
8484 int pos[2]={0};
8585
86− st = av_new_stream(s, 0);
86+ st = avformat_new_stream(s, NULL);
8787 if (!st)
8888 return -1;
8989 av_set_pts_info(st, 64, 1, 100);
libavformat/au.c+1−1
@@ -156,7 +156,7 @@ static int au_read_header(AVFormatContext *s, · 155 unmodified lines
156156 }
157157
158158 /* now we are ready: build format streams */
159− st = av_new_stream(s, 0);
159+ st = avformat_new_stream(s, NULL);
160160 if (!st)
161161 return -1;
162162 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/avformat.h+21−0
@@ -1402,6 +1402,7 @@ void av_close_input_file(AVFormatContext *s); · 1401 unmodified lines
14021402 */
14031403 void avformat_free_context(AVFormatContext *s);
14041404
1405+#if FF_API_NEW_STREAM
14051406 /**
14061407 * Add a new stream to a media file.
14071408 *
@@ -1412,7 +1413,27 @@ void avformat_free_context(AVFormatContext *s); · 4 unmodified lines
14121413 * @param s media file handle
14131414 * @param id file-format-dependent stream ID
14141415 */
1416+attribute_deprecated
14151417 AVStream *av_new_stream(AVFormatContext *s, int id);
1418+#endif
1419+
1420+/**
1421+ * Add a new stream to a media file.
1422+ *
1423+ * When demuxing, it is called by the demuxer in read_header(). If the
1424+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
1425+ * be called in read_packet().
1426+ *
1427+ * When muxing, should be called by the user before avformat_write_header().
1428+ *
1429+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
1430+ * will be initialized to use this codec. This is needed for e.g. codec-specific
1431+ * defaults to be set, so codec should be provided if it is known.
1432+ *
1433+ * @return newly created stream or NULL on error.
1434+ */
1435+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
1436+
14161437 AVProgram *av_new_program(AVFormatContext *s, int id);
14171438
14181439 /**
libavformat/avidec.c+2−1
@@ -454,10 +454,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) · 453 unmodified lines
454454 break;
455455 }else{
456456 stream_index++;
457− st = av_new_stream(s, stream_index);
457+ st = avformat_new_stream(s, NULL);
458458 if (!st)
459459 goto fail;
460460
461+ st->id = stream_index;
461462 ast = av_mallocz(sizeof(AVIStream));
462463 if (!ast)
463464 goto fail;
libavformat/avisynth.c+4−2
@@ -84,7 +84,8 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) · 83 unmodified lines
8484 if (AVIStreamReadFormat(stream->handle, 0, &wvfmt, &struct_size) != S_OK)
8585 continue;
8686
87− st = av_new_stream(s, id);
87+ st = avformat_new_stream(s, NULL);
88+ st->id = id;
8889 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
8990
9091 st->codec->block_align = wvfmt.nBlockAlign;
@@ -110,7 +111,8 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) · 19 unmodified lines
110111 if (AVIStreamReadFormat(stream->handle, 0, &imgfmt, &struct_size) != S_OK)
111112 continue;
112113
113− st = av_new_stream(s, id);
114+ st = avformat_new_stream(s, NULL);
115+ st->id = id;
114116 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
115117 st->r_frame_rate.num = stream->info.dwRate;
116118 st->r_frame_rate.den = stream->info.dwScale;
libavformat/avs.c+2−2
@@ -179,7 +179,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) · 178 unmodified lines
179179
180180 case AVS_VIDEO:
181181 if (!avs->st_video) {
182− avs->st_video = av_new_stream(s, AVS_VIDEO);
182+ avs->st_video = avformat_new_stream(s, NULL);
183183 if (avs->st_video == NULL)
184184 return AVERROR(ENOMEM);
185185 avs->st_video->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -196,7 +196,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) · 10 unmodified lines
196196
197197 case AVS_AUDIO:
198198 if (!avs->st_audio) {
199− avs->st_audio = av_new_stream(s, AVS_AUDIO);
199+ avs->st_audio = avformat_new_stream(s, NULL);
200200 if (avs->st_audio == NULL)
201201 return AVERROR(ENOMEM);
202202 avs->st_audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/bethsoftvid.c+2−2
@@ -70,7 +70,7 @@ static int vid_read_header(AVFormatContext *s, · 69 unmodified lines
7070 avio_skip(pb, 5);
7171 vid->nframes = avio_rl16(pb);
7272
73− stream = av_new_stream(s, 0);
73+ stream = avformat_new_stream(s, NULL);
7474 if (!stream)
7575 return AVERROR(ENOMEM);
7676 av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps
@@ -83,7 +83,7 @@ static int vid_read_header(AVFormatContext *s, · 6 unmodified lines
8383 avio_rl16(pb);
8484
8585 // done with video codec, set up audio codec
86− stream = av_new_stream(s, 0);
86+ stream = avformat_new_stream(s, NULL);
8787 if (!stream)
8888 return AVERROR(ENOMEM);
8989 stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/bfi.c+2−2
@@ -55,12 +55,12 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) · 54 unmodified lines
5555 int fps, chunk_header;
5656
5757 /* Initialize the video codec... */
58− vstream = av_new_stream(s, 0);
58+ vstream = avformat_new_stream(s, NULL);
5959 if (!vstream)
6060 return AVERROR(ENOMEM);
6161
6262 /* Initialize the audio codec... */
63− astream = av_new_stream(s, 0);
63+ astream = avformat_new_stream(s, NULL);
6464 if (!astream)
6565 return AVERROR(ENOMEM);
6666
libavformat/bink.c+2−2
@@ -78,7 +78,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 77 unmodified lines
7878 uint16_t flags;
7979 int keyframe;
8080
81− vst = av_new_stream(s, 0);
81+ vst = avformat_new_stream(s, NULL);
8282 if (!vst)
8383 return AVERROR(ENOMEM);
8484
@@ -130,7 +130,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 45 unmodified lines
130130 avio_skip(pb, 4 * bink->num_audio_tracks);
131131
132132 for (i = 0; i < bink->num_audio_tracks; i++) {
133− ast = av_new_stream(s, 1);
133+ ast = avformat_new_stream(s, NULL);
134134 if (!ast)
135135 return AVERROR(ENOMEM);
136136 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/c93.c+2−2
@@ -79,7 +79,7 @@ static int read_header(AVFormatContext *s, · 78 unmodified lines
7979 /* Audio streams are added if audio packets are found */
8080 s->ctx_flags |= AVFMTCTX_NOHEADER;
8181
82− video = av_new_stream(s, 0);
82+ video = avformat_new_stream(s, NULL);
8383 if (!video)
8484 return AVERROR(ENOMEM);
8585
@@ -117,7 +117,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) · 31 unmodified lines
117117 datasize = avio_rl16(pb);
118118 if (datasize > 42) {
119119 if (!c93->audio) {
120− c93->audio = av_new_stream(s, 1);
120+ c93->audio = avformat_new_stream(s, NULL);
121121 if (!c93->audio)
122122 return AVERROR(ENOMEM);
123123 c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/cafdec.c+1−1
@@ -61,7 +61,7 @@ static int read_desc_chunk(AVFormatContext *s) · 60 unmodified lines
6161 int flags;
6262
6363 /* new audio stream */
64− st = av_new_stream(s, 0);
64+ st = avformat_new_stream(s, NULL);
6565 if (!st)
6666 return AVERROR(ENOMEM);
6767
libavformat/cdg.c+1−1
@@ -28,7 +28,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 27 unmodified lines
2828 AVStream *vst;
2929 int ret;
3030
31− vst = av_new_stream(s, 0);
31+ vst = avformat_new_stream(s, NULL);
3232 if (!vst)
3333 return AVERROR(ENOMEM);
3434
libavformat/daud.c+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include "avformat.h"
2222
2323 static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
24− AVStream *st = av_new_stream(s, 0);
24+ AVStream *st = avformat_new_stream(s, NULL);
2525 if (!st)
2626 return AVERROR(ENOMEM);
2727 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/dfa.c+1−1
@@ -45,7 +45,7 @@ static int dfa_read_header(AVFormatContext *s, · 44 unmodified lines
4545 avio_skip(pb, 2); // unused
4646 frames = avio_rl16(pb);
4747
48− st = av_new_stream(s, 0);
48+ st = avformat_new_stream(s, NULL);
4949 if (!st)
5050 return AVERROR(ENOMEM);
5151
libavformat/dsicin.c+2−2
@@ -107,7 +107,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) · 106 unmodified lines
107107 cin->audio_buffer_size = 0;
108108
109109 /* initialize the video decoder stream */
110− st = av_new_stream(s, 0);
110+ st = avformat_new_stream(s, NULL);
111111 if (!st)
112112 return AVERROR(ENOMEM);
113113
@@ -120,7 +120,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) · 6 unmodified lines
120120 st->codec->height = hdr->video_frame_height;
121121
122122 /* initialize the audio decoder stream */
123− st = av_new_stream(s, 0);
123+ st = avformat_new_stream(s, NULL);
124124 if (!st)
125125 return AVERROR(ENOMEM);
126126
libavformat/dv.c+2−2
@@ -211,7 +211,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) · 210 unmodified lines
211211 /* Dynamic handling of the audio streams in DV */
212212 for (i = 0; i < ach; i++) {
213213 if (!c->ast[i]) {
214− c->ast[i] = av_new_stream(c->fctx, 0);
214+ c->ast[i] = avformat_new_stream(c->fctx, NULL);
215215 if (!c->ast[i])
216216 break;
217217 av_set_pts_info(c->ast[i], 64, 1, 30000);
@@ -278,7 +278,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s) · 60 unmodified lines
278278 if (!c)
279279 return NULL;
280280
281− c->vst = av_new_stream(s, 0);
281+ c->vst = avformat_new_stream(s, NULL);
282282 if (!c->vst) {
283283 av_free(c);
284284 return NULL;
libavformat/dxa.c+2−2
@@ -87,7 +87,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) · 86 unmodified lines
8787 h = avio_rb16(pb);
8888 c->has_sound = 0;
8989
90− st = av_new_stream(s, 0);
90+ st = avformat_new_stream(s, NULL);
9191 if (!st)
9292 return -1;
9393
@@ -100,7 +100,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) · 6 unmodified lines
100100 avio_skip(pb, 16);
101101 fsize = avio_rl32(pb);
102102
103− ast = av_new_stream(s, 0);
103+ ast = avformat_new_stream(s, NULL);
104104 if (!ast)
105105 return -1;
106106 ret = ff_get_wav_header(pb, ast->codec, fsize);
libavformat/eacdata.c+1−1
@@ -66,7 +66,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) · 65 unmodified lines
6666 sample_rate = avio_rb16(pb);
6767 avio_skip(pb, (avio_r8(pb) & 0x20) ? 15 : 11);
6868
69− st = av_new_stream(s, 0);
69+ st = avformat_new_stream(s, NULL);
7070 if (!st)
7171 return AVERROR(ENOMEM);
7272 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/electronicarts.c+2−2
@@ -408,7 +408,7 @@ static int ea_read_header(AVFormatContext *s, · 407 unmodified lines
408408
409409 if (ea->video_codec) {
410410 /* initialize the video decoder stream */
411− st = av_new_stream(s, 0);
411+ st = avformat_new_stream(s, NULL);
412412 if (!st)
413413 return AVERROR(ENOMEM);
414414 ea->video_stream_index = st->index;
@@ -437,7 +437,7 @@ static int ea_read_header(AVFormatContext *s, · 22 unmodified lines
437437 }
438438
439439 /* initialize the audio decoder stream */
440− st = av_new_stream(s, 0);
440+ st = avformat_new_stream(s, NULL);
441441 if (!st)
442442 return AVERROR(ENOMEM);
443443 av_set_pts_info(st, 33, 1, ea->sample_rate);
libavformat/ffmdec.c+1−1
@@ -295,7 +295,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 294 unmodified lines
295295 for(i=0;i<nb_streams;i++) {
296296 char rc_eq_buf[128];
297297
298− st = av_new_stream(s, 0);
298+ st = avformat_new_stream(s, NULL);
299299 if (!st)
300300 goto fail;
301301
libavformat/ffmetadec.c+1−1
@@ -132,7 +132,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 131 unmodified lines
132132 get_line(s->pb, line, sizeof(line));
133133
134134 if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
135− AVStream *st = av_new_stream(s, 0);
135+ AVStream *st = avformat_new_stream(s, NULL);
136136
137137 if (!st)
138138 return -1;
libavformat/filmstripdec.c+1−1
@@ -49,7 +49,7 @@ static int read_header(AVFormatContext *s, · 48 unmodified lines
4949 return AVERROR_INVALIDDATA;
5050 }
5151
52− st = av_new_stream(s, 0);
52+ st = avformat_new_stream(s, NULL);
5353 if (!st)
5454 return AVERROR(ENOMEM);
5555
libavformat/flacdec.c+1−1
@@ -31,7 +31,7 @@ static int flac_read_header(AVFormatContext *s, · 30 unmodified lines
3131 int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
3232 uint8_t header[4];
3333 uint8_t *buffer=NULL;
34− AVStream *st = av_new_stream(s, 0);
34+ AVStream *st = avformat_new_stream(s, NULL);
3535 if (!st)
3636 return AVERROR(ENOMEM);
3737 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/flic.c+2−2
@@ -105,7 +105,7 @@ static int flic_read_header(AVFormatContext *s, · 104 unmodified lines
105105 speed = FLIC_DEFAULT_SPEED;
106106
107107 /* initialize the decoder streams */
108− st = av_new_stream(s, 0);
108+ st = avformat_new_stream(s, NULL);
109109 if (!st)
110110 return AVERROR(ENOMEM);
111111 flic->video_stream_index = st->index;
@@ -145,7 +145,7 @@ static int flic_read_header(AVFormatContext *s, · 33 unmodified lines
145145 */
146146 if (AV_RL16(&preamble[4]) == FLIC_TFTD_CHUNK_AUDIO) {
147147 /* TFTD videos have an extra 22050 Hz 8-bit mono audio stream */
148− ast = av_new_stream(s, 1);
148+ ast = avformat_new_stream(s, NULL);
149149 if (!ast)
150150 return AVERROR(ENOMEM);
151151
libavformat/flvdec.c+2−1
@@ -347,9 +347,10 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos) { · 346 unmodified lines
347347 }
348348
349349 static AVStream *create_stream(AVFormatContext *s, int stream_type){
350− AVStream *st = av_new_stream(s, stream_type);
350+ AVStream *st = avformat_new_stream(s, NULL);
351351 if (!st)
352352 return NULL;
353+ st->id = stream_type;
353354 switch(stream_type) {
354355 case FLV_STREAM_TYPE_VIDEO: st->codec->codec_type = AVMEDIA_TYPE_VIDEO; break;
355356 case FLV_STREAM_TYPE_AUDIO: st->codec->codec_type = AVMEDIA_TYPE_AUDIO; break;
libavformat/gxf.c+2−1
@@ -81,9 +81,10 @@ static int get_sindex(AVFormatContext *s, int id, int format) { · 80 unmodified lines
8181 i = ff_find_stream_index(s, id);
8282 if (i >= 0)
8383 return i;
84− st = av_new_stream(s, id);
84+ st = avformat_new_stream(s, NULL);
8585 if (!st)
8686 return AVERROR(ENOMEM);
87+ st->id = id;
8788 switch (format) {
8889 case 3:
8990 case 4:
libavformat/idcin.c+2−2
@@ -153,7 +153,7 @@ static int idcin_read_header(AVFormatContext *s, · 152 unmodified lines
153153 bytes_per_sample = avio_rl32(pb);
154154 channels = avio_rl32(pb);
155155
156− st = av_new_stream(s, 0);
156+ st = avformat_new_stream(s, NULL);
157157 if (!st)
158158 return AVERROR(ENOMEM);
159159 av_set_pts_info(st, 33, 1, IDCIN_FPS);
@@ -174,7 +174,7 @@ static int idcin_read_header(AVFormatContext *s, · 14 unmodified lines
174174 /* if sample rate is 0, assume no audio */
175175 if (sample_rate) {
176176 idcin->audio_present = 1;
177− st = av_new_stream(s, 0);
177+ st = avformat_new_stream(s, NULL);
178178 if (!st)
179179 return AVERROR(ENOMEM);
180180 av_set_pts_info(st, 33, 1, IDCIN_FPS);
libavformat/idroqdec.c+2−2
@@ -84,7 +84,7 @@ static int roq_read_header(AVFormatContext *s, · 83 unmodified lines
8484 roq->audio_frame_count = 0;
8585 roq->audio_stream_index = -1;
8686
87− st = av_new_stream(s, 0);
87+ st = avformat_new_stream(s, NULL);
8888 if (!st)
8989 return AVERROR(ENOMEM);
9090 av_set_pts_info(st, 63, 1, framerate);
@@ -166,7 +166,7 @@ static int roq_read_packet(AVFormatContext *s, · 75 unmodified lines
166166 case RoQ_SOUND_MONO:
167167 case RoQ_SOUND_STEREO:
168168 if (roq->audio_stream_index == -1) {
169− AVStream *st = av_new_stream(s, 1);
169+ AVStream *st = avformat_new_stream(s, NULL);
170170 if (!st)
171171 return AVERROR(ENOMEM);
172172 av_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE);
libavformat/iff.c+1−1
@@ -135,7 +135,7 @@ static int iff_read_header(AVFormatContext *s, · 134 unmodified lines
135135 unsigned transparency = 0;
136136 unsigned masking = 0; // no mask
137137
138− st = av_new_stream(s, 0);
138+ st = avformat_new_stream(s, NULL);
139139 if (!st)
140140 return AVERROR(ENOMEM);
141141
libavformat/img2.c+1−1
@@ -220,7 +220,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) · 219 unmodified lines
220220
221221 s1->ctx_flags |= AVFMTCTX_NOHEADER;
222222
223− st = av_new_stream(s1, 0);
223+ st = avformat_new_stream(s1, NULL);
224224 if (!st) {
225225 return AVERROR(ENOMEM);
226226 }
libavformat/ipmovie.c+2−2
@@ -559,7 +559,7 @@ static int ipmovie_read_header(AVFormatContext *s, · 558 unmodified lines
559559 return AVERROR_INVALIDDATA;
560560
561561 /* initialize the stream decoders */
562− st = av_new_stream(s, 0);
562+ st = avformat_new_stream(s, NULL);
563563 if (!st)
564564 return AVERROR(ENOMEM);
565565 av_set_pts_info(st, 63, 1, 1000000);
@@ -572,7 +572,7 @@ static int ipmovie_read_header(AVFormatContext *s, · 6 unmodified lines
572572 st->codec->bits_per_coded_sample = ipmovie->video_bpp;
573573
574574 if (ipmovie->audio_type) {
575− st = av_new_stream(s, 0);
575+ st = avformat_new_stream(s, NULL);
576576 if (!st)
577577 return AVERROR(ENOMEM);
578578 av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
libavformat/iss.c+1−1
@@ -88,7 +88,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) · 87 unmodified lines
8888
8989 iss->sample_start_pos = avio_tell(pb);
9090
91− st = av_new_stream(s, 0);
91+ st = avformat_new_stream(s, NULL);
9292 if (!st)
9393 return AVERROR(ENOMEM);
9494 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/iv8.c+1−1
@@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 39 unmodified lines
4040 {
4141 AVStream *st;
4242
43− st = av_new_stream(s, 0);
43+ st = avformat_new_stream(s, NULL);
4444 if (!st)
4545 return AVERROR(ENOMEM);
4646
libavformat/ivfdec.c+1−1
@@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 39 unmodified lines
4040 avio_rl16(s->pb); // version
4141 avio_rl16(s->pb); // header size
4242
43− st = av_new_stream(s, 0);
43+ st = avformat_new_stream(s, NULL);
4444 if (!st)
4545 return AVERROR(ENOMEM);
4646
libavformat/jvdec.c+2−2
@@ -69,8 +69,8 @@ static int read_header(AVFormatContext *s, · 68 unmodified lines
6969
7070 avio_skip(pb, 80);
7171
72− ast = av_new_stream(s, 0);
73− vst = av_new_stream(s, 1);
72+ ast = avformat_new_stream(s, NULL);
73+ vst = avformat_new_stream(s, NULL);
7474 if (!ast || !vst)
7575 return AVERROR(ENOMEM);
7676
libavformat/libnut.c+1−1
@@ -213,7 +213,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { · 212 unmodified lines
213213 priv->s = s;
214214
215215 for (i = 0; s[i].type != -1 && i < 2; i++) {
216− AVStream * st = av_new_stream(avf, i);
216+ AVStream * st = avformat_new_stream(avf, NULL);
217217 int j;
218218
219219 for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->codec->codec_tag |= s[i].fourcc[j]<<(j*8);
libavformat/lmlm4.c+2−2
@@ -60,14 +60,14 @@ static int lmlm4_probe(AVProbeData * pd) { · 59 unmodified lines
6060 static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) {
6161 AVStream *st;
6262
63− if (!(st = av_new_stream(s, 0)))
63+ if (!(st = avformat_new_stream(s, NULL)))
6464 return AVERROR(ENOMEM);
6565 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
6666 st->codec->codec_id = CODEC_ID_MPEG4;
6767 st->need_parsing = AVSTREAM_PARSE_HEADERS;
6868 av_set_pts_info(st, 64, 1001, 30000);
6969
70− if (!(st = av_new_stream(s, 1)))
70+ if (!(st = avformat_new_stream(s, NULL)))
7171 return AVERROR(ENOMEM);
7272 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
7373 st->codec->codec_id = CODEC_ID_MP2;
libavformat/lxfdec.c+2−2
@@ -217,7 +217,7 @@ static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap) · 216 unmodified lines
217217 if ((ret = avio_read(pb, header_data, LXF_HEADER_DATA_SIZE)) != LXF_HEADER_DATA_SIZE)
218218 return ret < 0 ? ret : AVERROR_EOF;
219219
220− if (!(st = av_new_stream(s, 0)))
220+ if (!(st = avformat_new_stream(s, NULL)))
221221 return AVERROR(ENOMEM);
222222
223223 st->duration = AV_RL32(&header_data[32]);
@@ -243,7 +243,7 @@ static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap) · 19 unmodified lines
243243 av_log(s, AV_LOG_WARNING, "VBI data not yet supported\n");
244244
245245 if ((lxf->channels = (disk_params >> 2) & 0xF)) {
246− if (!(st = av_new_stream(s, 1)))
246+ if (!(st = avformat_new_stream(s, NULL)))
247247 return AVERROR(ENOMEM);
248248
249249 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/matroskadec.c+2−2
@@ -1444,7 +1444,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) · 1443 unmodified lines
14441444 }
14451445 }
14461446
1447− st = track->stream = av_new_stream(s, 0);
1447+ st = track->stream = avformat_new_stream(s, NULL);
14481448 if (st == NULL)
14491449 return AVERROR(ENOMEM);
14501450
@@ -1639,7 +1639,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) · 188 unmodified lines
16391639 attachements[j].bin.data && attachements[j].bin.size > 0)) {
16401640 av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n");
16411641 } else {
1642− AVStream *st = av_new_stream(s, 0);
1642+ AVStream *st = avformat_new_stream(s, NULL);
16431643 if (st == NULL)
16441644 break;
16451645 av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
libavformat/mm.c+2−2
@@ -105,7 +105,7 @@ static int read_header(AVFormatContext *s, · 104 unmodified lines
105105 avio_skip(pb, length - 10); /* unknown data */
106106
107107 /* video stream */
108− st = av_new_stream(s, 0);
108+ st = avformat_new_stream(s, NULL);
109109 if (!st)
110110 return AVERROR(ENOMEM);
111111 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -117,7 +117,7 @@ static int read_header(AVFormatContext *s, · 5 unmodified lines
117117
118118 /* audio stream */
119119 if (length == MM_HEADER_LEN_AV) {
120− st = av_new_stream(s, 0);
120+ st = avformat_new_stream(s, NULL);
121121 if (!st)
122122 return AVERROR(ENOMEM);
123123 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/mmf.c+1−1
@@ -241,7 +241,7 @@ static int mmf_read_header(AVFormatContext *s, · 240 unmodified lines
241241 }
242242 mmf->data_size = size;
243243
244− st = av_new_stream(s, 0);
244+ st = avformat_new_stream(s, NULL);
245245 if (!st)
246246 return AVERROR(ENOMEM);
247247
libavformat/mov.c+2−1
@@ -1843,8 +1843,9 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 1842 unmodified lines
18431843 MOVStreamContext *sc;
18441844 int ret;
18451845
1846− st = av_new_stream(c->fc, c->fc->nb_streams);
1846+ st = avformat_new_stream(c->fc, NULL);
18471847 if (!st) return AVERROR(ENOMEM);
1848+ st->id = c->fc->nb_streams;
18481849 sc = av_mallocz(sizeof(MOVStreamContext));
18491850 if (!sc) return AVERROR(ENOMEM);
18501851
libavformat/mp3dec.c+1−1
@@ -137,7 +137,7 @@ static int mp3_read_header(AVFormatContext *s, · 136 unmodified lines
137137 AVStream *st;
138138 int64_t off;
139139
140− st = av_new_stream(s, 0);
140+ st = avformat_new_stream(s, NULL);
141141 if (!st)
142142 return AVERROR(ENOMEM);
143143
libavformat/mpc.c+1−1
@@ -84,7 +84,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) · 83 unmodified lines
8484 c->curbits = 8;
8585 c->frames_noted = 0;
8686
87− st = av_new_stream(s, 0);
87+ st = avformat_new_stream(s, NULL);
8888 if (!st)
8989 return AVERROR(ENOMEM);
9090 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/mpc8.c+1−1
@@ -222,7 +222,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) · 221 unmodified lines
222222 c->samples = ffio_read_varlen(pb);
223223 ffio_read_varlen(pb); //silence samples at the beginning
224224
225− st = av_new_stream(s, 0);
225+ st = avformat_new_stream(s, NULL);
226226 if (!st)
227227 return AVERROR(ENOMEM);
228228 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/mpeg.c+2−1
@@ -537,9 +537,10 @@ static int mpegps_read_packet(AVFormatContext *s, · 536 unmodified lines
537537 goto redo;
538538 }
539539 /* no stream found: add a new stream */
540− st = av_new_stream(s, startcode);
540+ st = avformat_new_stream(s, NULL);
541541 if (!st)
542542 goto skip;
543+ st->id = startcode;
543544 st->codec->codec_type = type;
544545 st->codec->codec_id = codec_id;
545546 st->request_probe = request_probe;
libavformat/mpegts.c+13−7
@@ -620,12 +620,13 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, · 619 unmodified lines
620620 return AVERROR(ENOMEM);
621621 memcpy(sub_pes, pes, sizeof(*sub_pes));
622622
623− sub_st = av_new_stream(pes->stream, pes->pid);
623+ sub_st = avformat_new_stream(pes->stream, NULL);
624624 if (!sub_st) {
625625 av_free(sub_pes);
626626 return AVERROR(ENOMEM);
627627 }
628628
629+ sub_st->id = pes->pid;
629630 av_set_pts_info(sub_st, 33, 1, 90000);
630631 sub_st->priv_data = sub_pes;
631632 sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -726,9 +727,10 @@ static int mpegts_push_data(MpegTSFilter *filter, · 94 unmodified lines
726727
727728 /* stream not present in PMT */
728729 if (!pes->st) {
729− pes->st = av_new_stream(ts->stream, pes->pid);
730+ pes->st = avformat_new_stream(ts->stream, NULL);
730731 if (!pes->st)
731732 return AVERROR(ENOMEM);
733+ pes->st->id = pes->pid;
732734 mpegts_set_stream_info(pes->st, pes, 0, 0);
733735 }
734736
@@ -1120,14 +1122,18 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len · 385 unmodified lines
11201122 /* now create ffmpeg stream */
11211123 if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
11221124 pes = ts->pids[pid]->u.pes_filter.opaque;
1123− if (!pes->st)
1124− pes->st = av_new_stream(pes->stream, pes->pid);
1125+ if (!pes->st) {
1126+ pes->st = avformat_new_stream(pes->stream, NULL);
1127+ st->id = pes->pid;
1128+ }
11251129 st = pes->st;
11261130 } else {
11271131 if (ts->pids[pid]) mpegts_close_filter(ts, ts->pids[pid]); //wrongly added sdt filter probably
11281132 pes = add_pes_stream(ts, pid, pcr_pid);
1129− if (pes)
1130− st = av_new_stream(pes->stream, pes->pid);
1133+ if (pes) {
1134+ st = avformat_new_stream(pes->stream, NULL);
1135+ st->id = pes->pid;
1136+ }
11311137 }
11321138
11331139 if (!st)
@@ -1594,7 +1600,7 @@ static int mpegts_read_header(AVFormatContext *s, · 460 unmodified lines
15941600
15951601 /* only read packets */
15961602
1597− st = av_new_stream(s, 0);
1603+ st = avformat_new_stream(s, NULL);
15981604 if (!st)
15991605 goto fail;
16001606 av_set_pts_info(st, 60, 1, 27000000);
libavformat/msnwc_tcp.c+1−1
@@ -75,7 +75,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) · 74 unmodified lines
7575 AVCodecContext *codec;
7676 AVStream *st;
7777
78− st = av_new_stream(ctx, 0);
78+ st = avformat_new_stream(ctx, NULL);
7979 if(!st)
8080 return AVERROR(ENOMEM);
8181
libavformat/mtv.c+4−6
@@ -32,8 +32,6 @@ · 31 unmodified lines
3232 #define MTV_HEADER_SIZE 512
3333 #define MTV_AUDIO_PADDING_SIZE 12
3434 #define AUDIO_SAMPLING_RATE 44100
35−#define VIDEO_SID 0
36−#define AUDIO_SID 1
3735
3836 typedef struct MTVDemuxContext {
3937
@@ -118,7 +116,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) · 78 unmodified lines
118116
119117 // video - raw rgb565
120118
121− st = av_new_stream(s, VIDEO_SID);
119+ st = avformat_new_stream(s, NULL);
122120 if(!st)
123121 return AVERROR(ENOMEM);
124122
@@ -134,7 +132,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) · 9 unmodified lines
134132
135133 // audio - mp3
136134
137− st = av_new_stream(s, AUDIO_SID);
135+ st = avformat_new_stream(s, NULL);
138136 if(!st)
139137 return AVERROR(ENOMEM);
140138
@@ -171,7 +169,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) · 30 unmodified lines
171169 return ret;
172170
173171 pkt->pos -= MTV_AUDIO_PADDING_SIZE;
174− pkt->stream_index = AUDIO_SID;
172+ pkt->stream_index = 1;
175173
176174 }else
177175 {
@@ -190,7 +188,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) · 12 unmodified lines
190188 for(i=0;i<mtv->img_segment_size/2;i++)
191189 *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
192190 #endif
193− pkt->stream_index = VIDEO_SID;
191+ pkt->stream_index = 0;
194192 }
195193
196194 return ret;
libavformat/mvi.c+2−2
@@ -42,11 +42,11 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) · 41 unmodified lines
4242 AVStream *ast, *vst;
4343 unsigned int version, frames_count, msecs_per_frame, player_version;
4444
45− ast = av_new_stream(s, 0);
45+ ast = avformat_new_stream(s, NULL);
4646 if (!ast)
4747 return AVERROR(ENOMEM);
4848
49− vst = av_new_stream(s, 0);
49+ vst = avformat_new_stream(s, NULL);
5050 if (!vst)
5151 return AVERROR(ENOMEM);
5252
libavformat/mxfdec.c+2−1
@@ -852,11 +852,12 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) · 851 unmodified lines
852852 if (!source_track)
853853 continue;
854854
855− st = av_new_stream(mxf->fc, source_track->track_id);
855+ st = avformat_new_stream(mxf->fc, NULL);
856856 if (!st) {
857857 av_log(mxf->fc, AV_LOG_ERROR, "could not allocate stream\n");
858858 return -1;
859859 }
860+ st->id = source_track->track_id;
860861 st->priv_data = source_track;
861862 st->duration = component->duration;
862863 if (st->duration == -1)
libavformat/mxg.c+4−6
@@ -24,8 +24,6 @@ · 23 unmodified lines
2424 #include "avformat.h"
2525 #include "avio.h"
2626
27−#define VIDEO_STREAM_INDEX 0
28−#define AUDIO_STREAM_INDEX 1
2927 #define DEFAULT_PACKET_SIZE 1024
3028 #define OVERREAD_SIZE 3
3129
@@ -44,14 +42,14 @@ static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap) · 12 unmodified lines
4442 MXGContext *mxg = s->priv_data;
4543
4644 /* video parameters will be extracted from the compressed bitstream */
47− video_st = av_new_stream(s, VIDEO_STREAM_INDEX);
45+ video_st = avformat_new_stream(s, NULL);
4846 if (!video_st)
4947 return AVERROR(ENOMEM);
5048 video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
5149 video_st->codec->codec_id = CODEC_ID_MXPEG;
5250 av_set_pts_info(video_st, 64, 1, 1000000);
5351
54− audio_st = av_new_stream(s, AUDIO_STREAM_INDEX);
52+ audio_st = avformat_new_stream(s, NULL);
5553 if (!audio_st)
5654 return AVERROR(ENOMEM);
5755 audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -166,7 +164,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) · 108 unmodified lines
166164 }
167165
168166 pkt->pts = pkt->dts = mxg->dts;
169− pkt->stream_index = VIDEO_STREAM_INDEX;
167+ pkt->stream_index = 0;
170168 pkt->destruct = NULL;
171169 pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
172170 pkt->data = mxg->soi_ptr;
@@ -204,7 +202,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) · 31 unmodified lines
204202 if (marker == APP13 && size >= 16) { /* audio data */
205203 /* time (GMT) of first sample in usec since 1970, little-endian */
206204 pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
207− pkt->stream_index = AUDIO_STREAM_INDEX;
205+ pkt->stream_index = 1;
208206 pkt->destruct = NULL;
209207 pkt->size = size - 14;
210208 pkt->data = startmarker_ptr + 16;
libavformat/ncdec.c+1−1
@@ -45,7 +45,7 @@ static int nc_probe(AVProbeData *probe_packet) · 44 unmodified lines
4545
4646 static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap)
4747 {
48− AVStream *st = av_new_stream(s, 0);
48+ AVStream *st = avformat_new_stream(s, NULL);
4949
5050 if (!st)
5151 return AVERROR(ENOMEM);
libavformat/nsvdec.c+4−2
@@ -438,10 +438,11 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) · 437 unmodified lines
438438 nsv->vheight = vwidth;
439439 if (vtag != T_NONE) {
440440 int i;
441− st = av_new_stream(s, NSV_ST_VIDEO);
441+ st = avformat_new_stream(s, NULL);
442442 if (!st)
443443 goto fail;
444444
445+ st->id = NSV_ST_VIDEO;
445446 nst = av_mallocz(sizeof(NSVStream));
446447 if (!nst)
447448 goto fail;
@@ -469,10 +470,11 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) · 21 unmodified lines
469470 }
470471 if (atag != T_NONE) {
471472 #ifndef DISABLE_AUDIO
472− st = av_new_stream(s, NSV_ST_AUDIO);
473+ st = avformat_new_stream(s, NULL);
473474 if (!st)
474475 goto fail;
475476
477+ st->id = NSV_ST_AUDIO;
476478 nst = av_mallocz(sizeof(NSVStream));
477479 if (!nst)
478480 goto fail;
libavformat/nutdec.c+1−1
@@ -288,7 +288,7 @@ static int decode_main_header(NUTContext *nut){ · 287 unmodified lines
288288
289289 nut->stream = av_mallocz(sizeof(StreamContext)*stream_count);
290290 for(i=0; i<stream_count; i++){
291− av_new_stream(s, i);
291+ avformat_new_stream(s, NULL);
292292 }
293293
294294 return 0;
libavformat/nuv.c+2−2
@@ -153,7 +153,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { · 152 unmodified lines
153153
154154 if (v_packs) {
155155 ctx->v_id = stream_nr++;
156− vst = av_new_stream(s, ctx->v_id);
156+ vst = avformat_new_stream(s, NULL);
157157 if (!vst)
158158 return AVERROR(ENOMEM);
159159 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -169,7 +169,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { · 9 unmodified lines
169169
170170 if (a_packs) {
171171 ctx->a_id = stream_nr++;
172− ast = av_new_stream(s, ctx->a_id);
172+ ast = avformat_new_stream(s, NULL);
173173 if (!ast)
174174 return AVERROR(ENOMEM);
175175 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/oggdec.c+2−1
@@ -171,10 +171,11 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream) · 170 unmodified lines
171171 os->header = -1;
172172
173173 if (new_avstream) {
174− st = av_new_stream(s, idx);
174+ st = avformat_new_stream(s, NULL);
175175 if (!st)
176176 return AVERROR(ENOMEM);
177177
178+ st->id = idx;
178179 av_set_pts_info(st, 64, 1, 1000000);
179180 }
180181
libavformat/oma.c+1−1
@@ -307,7 +307,7 @@ static int oma_read_header(AVFormatContext *s, · 306 unmodified lines
307307
308308 codec_params = AV_RB24(&buf[33]);
309309
310− st = av_new_stream(s, 0);
310+ st = avformat_new_stream(s, NULL);
311311 if (!st)
312312 return AVERROR(ENOMEM);
313313
libavformat/psxstr.c+2−2
@@ -196,7 +196,7 @@ static int str_read_packet(AVFormatContext *s, · 195 unmodified lines
196196
197197 if(str->channels[channel].video_stream_index < 0){
198198 /* allocate a new AVStream */
199− st = av_new_stream(s, 0);
199+ st = avformat_new_stream(s, NULL);
200200 if (!st)
201201 return AVERROR(ENOMEM);
202202 av_set_pts_info(st, 64, 1, 15);
@@ -244,7 +244,7 @@ static int str_read_packet(AVFormatContext *s, · 41 unmodified lines
244244 if(str->channels[channel].audio_stream_index < 0){
245245 int fmt = sector[0x13];
246246 /* allocate a new AVStream */
247− st = av_new_stream(s, 0);
247+ st = avformat_new_stream(s, NULL);
248248 if (!st)
249249 return AVERROR(ENOMEM);
250250
libavformat/pva.c+2−2
@@ -56,7 +56,7 @@ static int pva_probe(AVProbeData * pd) { · 55 unmodified lines
5656 static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) {
5757 AVStream *st;
5858
59− if (!(st = av_new_stream(s, 0)))
59+ if (!(st = avformat_new_stream(s, NULL)))
6060 return AVERROR(ENOMEM);
6161 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
6262 st->codec->codec_id = CODEC_ID_MPEG2VIDEO;
@@ -64,7 +64,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { · 1 unmodified line
6464 av_set_pts_info(st, 32, 1, 90000);
6565 av_add_index_entry(st, 0, 0, 0, 0, AVINDEX_KEYFRAME);
6666
67− if (!(st = av_new_stream(s, 1)))
67+ if (!(st = avformat_new_stream(s, NULL)))
6868 return AVERROR(ENOMEM);
6969 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
7070 st->codec->codec_id = CODEC_ID_MP2;
libavformat/qcp.c+1−1
@@ -84,7 +84,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) · 83 unmodified lines
8484 {
8585 AVIOContext *pb = s->pb;
8686 QCPContext *c = s->priv_data;
87− AVStream *st = av_new_stream(s, 0);
87+ AVStream *st = avformat_new_stream(s, NULL);
8888 uint8_t buf[16];
8989 int i, nb_rates;
9090
libavformat/r3d.c+2−2
@@ -52,7 +52,7 @@ static int read_atom(AVFormatContext *s, Atom *atom) · 51 unmodified lines
5252
5353 static int r3d_read_red1(AVFormatContext *s)
5454 {
55− AVStream *st = av_new_stream(s, 0);
55+ AVStream *st = avformat_new_stream(s, NULL);
5656 char filename[258];
5757 int tmp;
5858 int av_unused tmp2;
@@ -89,7 +89,7 @@ static int r3d_read_red1(AVFormatContext *s) · 30 unmodified lines
8989 tmp = avio_r8(s->pb); // audio channels
9090 av_dlog(s, "audio channels %d\n", tmp);
9191 if (tmp > 0) {
92− AVStream *ast = av_new_stream(s, 1);
92+ AVStream *ast = avformat_new_stream(s, NULL);
9393 if (!ast)
9494 return AVERROR(ENOMEM);
9595 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/rawdec.c+3−3
@@ -33,7 +33,7 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 32 unmodified lines
3333 AVStream *st;
3434 enum CodecID id;
3535
36− st = av_new_stream(s, 0);
36+ st = avformat_new_stream(s, NULL);
3737 if (!st)
3838 return AVERROR(ENOMEM);
3939
@@ -122,7 +122,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) · 82 unmodified lines
122122 int ff_raw_audio_read_header(AVFormatContext *s,
123123 AVFormatParameters *ap)
124124 {
125− AVStream *st = av_new_stream(s, 0);
125+ AVStream *st = avformat_new_stream(s, NULL);
126126 if (!st)
127127 return AVERROR(ENOMEM);
128128 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -144,7 +144,7 @@ int ff_raw_video_read_header(AVFormatContext *s, · 15 unmodified lines
144144 int ret = 0;
145145
146146
147− st = av_new_stream(s, 0);
147+ st = avformat_new_stream(s, NULL);
148148 if (!st) {
149149 ret = AVERROR(ENOMEM);
150150 goto fail;
libavformat/rdt.c+2−1
@@ -459,8 +459,9 @@ add_dstream(AVFormatContext *s, AVStream *orig_st) · 458 unmodified lines
459459 {
460460 AVStream *st;
461461
462− if (!(st = av_new_stream(s, orig_st->id)))
462+ if (!(st = avformat_new_stream(s, NULL)))
463463 return NULL;
464+ st->id = orig_st->id;
464465 st->codec->codec_type = orig_st->codec->codec_type;
465466 st->first_dts = orig_st->first_dts;
466467
libavformat/riff.c+2−2
@@ -281,10 +281,10 @@ const AVCodecTag ff_codec_bmp_tags[] = { · 280 unmodified lines
281281 { CODEC_ID_G2M, MKTAG('G', '2', 'M', '3') },
282282 { CODEC_ID_G2M, MKTAG('G', '2', 'M', '4') },
283283 { CODEC_ID_AMV, MKTAG('A', 'M', 'V', 'F') },
284+ { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'R', 'A') },
285+ { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'R', 'G') },
284286 { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'Y', '0') },
285287 { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'Y', '2') },
286− { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'R', 'G') },
287− { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'R', 'A') },
288288 { CODEC_ID_NONE, 0 }
289289 };
290290
libavformat/rl2.c+2−2
@@ -110,7 +110,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 109 unmodified lines
110110 def_sound_size = avio_rl16(pb);
111111
112112 /** setup video stream */
113− st = av_new_stream(s, 0);
113+ st = avformat_new_stream(s, NULL);
114114 if(!st)
115115 return AVERROR(ENOMEM);
116116
@@ -140,7 +140,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 23 unmodified lines
140140 pts_num = def_sound_size;
141141 pts_den = rate;
142142
143− st = av_new_stream(s, 0);
143+ st = avformat_new_stream(s, NULL);
144144 if (!st)
145145 return AVERROR(ENOMEM);
146146 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/rmdec.c+2−2
@@ -397,7 +397,7 @@ static int rm_read_header_old(AVFormatContext *s) · 396 unmodified lines
397397 AVStream *st;
398398
399399 rm->old_format = 1;
400− st = av_new_stream(s, 0);
400+ st = avformat_new_stream(s, NULL);
401401 if (!st)
402402 return -1;
403403 st->priv_data = ff_rm_alloc_rmstream();
@@ -463,7 +463,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 59 unmodified lines
463463 rm_read_metadata(s, 1);
464464 break;
465465 case MKTAG('M', 'D', 'P', 'R'):
466− st = av_new_stream(s, 0);
466+ st = avformat_new_stream(s, NULL);
467467 if (!st)
468468 return AVERROR(ENOMEM);
469469 st->id = avio_rb16(pb);
libavformat/rpl.c+2−2
@@ -139,7 +139,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) · 138 unmodified lines
139139 av_dict_set(&s->metadata, "author" , line, 0);
140140
141141 // video headers
142− vst = av_new_stream(s, 0);
142+ vst = avformat_new_stream(s, NULL);
143143 if (!vst)
144144 return AVERROR(ENOMEM);
145145 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -181,7 +181,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) · 35 unmodified lines
181181 // samples, though. This code will ignore additional tracks.
182182 audio_format = read_line_and_int(pb, &error); // audio format ID
183183 if (audio_format) {
184− ast = av_new_stream(s, 0);
184+ ast = avformat_new_stream(s, NULL);
185185 if (!ast)
186186 return AVERROR(ENOMEM);
187187 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/rsodec.c+1−1
@@ -54,7 +54,7 @@ static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap) · 53 unmodified lines
5454 }
5555
5656 /* now we are ready: build format streams */
57− st = av_new_stream(s, 0);
57+ st = avformat_new_stream(s, NULL);
5858 if (!st)
5959 return AVERROR(ENOMEM);
6060
libavformat/rtpenc_chain.c+1−1
@@ -43,7 +43,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 42 unmodified lines
4343 return NULL;
4444
4545 rtpctx->oformat = rtp_format;
46− if (!av_new_stream(rtpctx, 0)) {
46+ if (!avformat_new_stream(rtpctx, NULL)) {
4747 av_free(rtpctx);
4848 return NULL;
4949 }
libavformat/rtsp.c+2−1
@@ -357,9 +357,10 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, · 356 unmodified lines
357357 if (!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T")) {
358358 /* no corresponding stream */
359359 } else {
360− st = av_new_stream(s, rt->nb_rtsp_streams - 1);
360+ st = avformat_new_stream(s, NULL);
361361 if (!st)
362362 return;
363+ st->id = rt->nb_rtsp_streams - 1;
363364 rtsp_st->stream_index = st->index;
364365 st->codec->codec_type = codec_type;
365366 if (rtsp_st->sdp_payload_type < RTP_PT_PRIVATE) {
libavformat/sapdec.c+4−2
@@ -163,11 +163,12 @@ static int sap_read_header(AVFormatContext *s, · 162 unmodified lines
163163 if (sap->sdp_ctx->ctx_flags & AVFMTCTX_NOHEADER)
164164 s->ctx_flags |= AVFMTCTX_NOHEADER;
165165 for (i = 0; i < sap->sdp_ctx->nb_streams; i++) {
166− AVStream *st = av_new_stream(s, i);
166+ AVStream *st = avformat_new_stream(s, NULL);
167167 if (!st) {
168168 ret = AVERROR(ENOMEM);
169169 goto fail;
170170 }
171+ st->id = i;
171172 avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
172173 st->time_base = sap->sdp_ctx->streams[i]->time_base;
173174 }
@@ -211,11 +212,12 @@ static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt) · 37 unmodified lines
211212 if (s->ctx_flags & AVFMTCTX_NOHEADER) {
212213 while (sap->sdp_ctx->nb_streams > s->nb_streams) {
213214 int i = s->nb_streams;
214− AVStream *st = av_new_stream(s, i);
215+ AVStream *st = avformat_new_stream(s, NULL);
215216 if (!st) {
216217 av_free_packet(pkt);
217218 return AVERROR(ENOMEM);
218219 }
220+ st->id = i;
219221 avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
220222 st->time_base = sap->sdp_ctx->streams[i]->time_base;
221223 }
libavformat/segafilm.c+2−2
@@ -134,7 +134,7 @@ static int film_read_header(AVFormatContext *s, · 133 unmodified lines
134134
135135 /* initialize the decoder streams */
136136 if (film->video_type) {
137− st = av_new_stream(s, 0);
137+ st = avformat_new_stream(s, NULL);
138138 if (!st)
139139 return AVERROR(ENOMEM);
140140 film->video_stream_index = st->index;
@@ -146,7 +146,7 @@ static int film_read_header(AVFormatContext *s, · 5 unmodified lines
146146 }
147147
148148 if (film->audio_type) {
149− st = av_new_stream(s, 0);
149+ st = avformat_new_stream(s, NULL);
150150 if (!st)
151151 return AVERROR(ENOMEM);
152152 film->audio_stream_index = st->index;
libavformat/sierravmd.c+2−2
@@ -104,7 +104,7 @@ static int vmd_read_header(AVFormatContext *s, · 103 unmodified lines
104104 else
105105 vmd->is_indeo3 = 0;
106106 /* start up the decoders */
107− vst = av_new_stream(s, 0);
107+ vst = avformat_new_stream(s, NULL);
108108 if (!vst)
109109 return AVERROR(ENOMEM);
110110 av_set_pts_info(vst, 33, 1, 10);
@@ -125,7 +125,7 @@ static int vmd_read_header(AVFormatContext *s, · 14 unmodified lines
125125 /* if sample rate is 0, assume no audio */
126126 vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
127127 if (vmd->sample_rate) {
128− st = av_new_stream(s, 0);
128+ st = avformat_new_stream(s, NULL);
129129 if (!st)
130130 return AVERROR(ENOMEM);
131131 vmd->audio_stream_index = st->index;
libavformat/siff.c+2−2
@@ -71,7 +71,7 @@ static int siff_probe(AVProbeData *p) · 70 unmodified lines
7171 static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
7272 {
7373 AVStream *ast;
74− ast = av_new_stream(s, 0);
74+ ast = avformat_new_stream(s, NULL);
7575 if (!ast)
7676 return -1;
7777 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -115,7 +115,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb) · 37 unmodified lines
115115
116116 avio_skip(pb, 16); //zeroes
117117
118− st = av_new_stream(s, 0);
118+ st = avformat_new_stream(s, NULL);
119119 if (!st)
120120 return -1;
121121 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
libavformat/smacker.c+2−2
@@ -154,7 +154,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) · 153 unmodified lines
154154 }
155155
156156 /* init video codec */
157− st = av_new_stream(s, 0);
157+ st = avformat_new_stream(s, NULL);
158158 if (!st)
159159 return -1;
160160 smk->videoindex = st->index;
@@ -177,7 +177,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) · 16 unmodified lines
177177 for(i = 0; i < 7; i++) {
178178 smk->indexes[i] = -1;
179179 if (smk->rates[i]) {
180− ast[i] = av_new_stream(s, 0);
180+ ast[i] = avformat_new_stream(s, NULL);
181181 smk->indexes[i] = ast[i]->index;
182182 ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
183183 if (smk->aflags[i] & SMK_AUD_BINKAUD) {
libavformat/sol.c+1−1
@@ -110,7 +110,7 @@ static int sol_read_header(AVFormatContext *s, · 109 unmodified lines
110110 else id = 0;
111111
112112 /* now we are ready: build format streams */
113− st = av_new_stream(s, 0);
113+ st = avformat_new_stream(s, NULL);
114114 if (!st)
115115 return -1;
116116 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/soxdec.c+1−1
@@ -51,7 +51,7 @@ static int sox_read_header(AVFormatContext *s, · 50 unmodified lines
5151 double sample_rate, sample_rate_frac;
5252 AVStream *st;
5353
54− st = av_new_stream(s, 0);
54+ st = avformat_new_stream(s, NULL);
5555 if (!st)
5656 return AVERROR(ENOMEM);
5757
libavformat/spdifdec.c+1−1
@@ -205,7 +205,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt) · 204 unmodified lines
205205
206206 if (!s->nb_streams) {
207207 /* first packet, create a stream */
208− AVStream *st = av_new_stream(s, 0);
208+ AVStream *st = avformat_new_stream(s, NULL);
209209 if (!st) {
210210 av_free_packet(pkt);
211211 return AVERROR(ENOMEM);
libavformat/srtdec.c+1−1
@@ -42,7 +42,7 @@ static int srt_probe(AVProbeData *p) · 41 unmodified lines
4242
4343 static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap)
4444 {
45− AVStream *st = av_new_stream(s, 0);
45+ AVStream *st = avformat_new_stream(s, NULL);
4646 if (!st)
4747 return -1;
4848 av_set_pts_info(st, 64, 1, 1000);
libavformat/swfdec.c+6−3
@@ -106,9 +106,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) · 105 unmodified lines
106106 avio_rl16(pb);
107107 avio_r8(pb);
108108 /* Check for FLV1 */
109− vst = av_new_stream(s, ch_id);
109+ vst = avformat_new_stream(s, NULL);
110110 if (!vst)
111111 return -1;
112+ vst->id = ch_id;
112113 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
113114 vst->codec->codec_id = ff_codec_get_id(swf_codec_tags, avio_r8(pb));
114115 av_set_pts_info(vst, 16, 256, swf->frame_rate);
@@ -127,9 +128,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) · 12 unmodified lines
127128 avio_r8(pb);
128129 v = avio_r8(pb);
129130 swf->samples_per_frame = avio_rl16(pb);
130− ast = av_new_stream(s, -1); /* -1 to avoid clash with video stream ch_id */
131+ ast = avformat_new_stream(s, NULL);
131132 if (!ast)
132133 return -1;
134+ ast->id = -1; /* -1 to avoid clash with video stream ch_id */
133135 ast->codec->channels = 1 + (v&1);
134136 ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
135137 ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
@@ -177,9 +179,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) · 41 unmodified lines
177179 break;
178180 }
179181 if (i == s->nb_streams) {
180− vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */
182+ vst = avformat_new_stream(s, NULL);
181183 if (!vst)
182184 return -1;
185+ vst->id = -2; /* -2 to avoid clash with video stream and audio stream */
183186 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
184187 vst->codec->codec_id = CODEC_ID_MJPEG;
185188 av_set_pts_info(vst, 64, 256, swf->frame_rate);
libavformat/thp.c+2−2
@@ -94,7 +94,7 @@ static int thp_read_header(AVFormatContext *s, · 93 unmodified lines
9494 break;
9595
9696 /* Video component. */
97− st = av_new_stream(s, 0);
97+ st = avformat_new_stream(s, NULL);
9898 if (!st)
9999 return AVERROR(ENOMEM);
100100
@@ -117,7 +117,7 @@ static int thp_read_header(AVFormatContext *s, · 16 unmodified lines
117117 break;
118118
119119 /* Audio component. */
120− st = av_new_stream(s, 0);
120+ st = avformat_new_stream(s, NULL);
121121 if (!st)
122122 return AVERROR(ENOMEM);
123123
libavformat/tiertexseq.c+2−2
@@ -206,7 +206,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) · 205 unmodified lines
206206 seq->audio_buffer_full = 0;
207207
208208 /* initialize the video decoder stream */
209− st = av_new_stream(s, 0);
209+ st = avformat_new_stream(s, NULL);
210210 if (!st)
211211 return AVERROR(ENOMEM);
212212
@@ -219,7 +219,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) · 6 unmodified lines
219219 st->codec->height = SEQ_FRAME_H;
220220
221221 /* initialize the audio decoder stream */
222− st = av_new_stream(s, 0);
222+ st = avformat_new_stream(s, NULL);
223223 if (!st)
224224 return AVERROR(ENOMEM);
225225
libavformat/tmv.c+2−2
@@ -73,10 +73,10 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) · 72 unmodified lines
7373 if (avio_rl32(pb) != TMV_TAG)
7474 return -1;
7575
76− if (!(vst = av_new_stream(s, 0)))
76+ if (!(vst = avformat_new_stream(s, NULL)))
7777 return AVERROR(ENOMEM);
7878
79− if (!(ast = av_new_stream(s, 0)))
79+ if (!(ast = avformat_new_stream(s, NULL)))
8080 return AVERROR(ENOMEM);
8181
8282 ast->codec->sample_rate = avio_rl16(pb);
libavformat/tta.c+1−1
@@ -77,7 +77,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) · 76 unmodified lines
7777 return -1;
7878 }
7979
80− st = av_new_stream(s, 0);
80+ st = avformat_new_stream(s, NULL);
8181 if (!st)
8282 return AVERROR(ENOMEM);
8383
libavformat/tty.c+1−1
@@ -76,7 +76,7 @@ static int read_header(AVFormatContext *avctx, · 75 unmodified lines
7676 {
7777 TtyDemuxContext *s = avctx->priv_data;
7878 int width = 0, height = 0, ret = 0;
79− AVStream *st = av_new_stream(avctx, 0);
79+ AVStream *st = avformat_new_stream(avctx, NULL);
8080 AVRational framerate;
8181
8282 if (!st) {
libavformat/txd.c+1−1
@@ -40,7 +40,7 @@ static int txd_probe(AVProbeData * pd) { · 39 unmodified lines
4040 static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
4141 AVStream *st;
4242
43− st = av_new_stream(s, 0);
43+ st = avformat_new_stream(s, NULL);
4444 if (!st)
4545 return AVERROR(ENOMEM);
4646 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
libavformat/utils.c+11−2
@@ -2762,7 +2762,17 @@ void av_close_input_file(AVFormatContext *s) · 2761 unmodified lines
27622762 avio_close(pb);
27632763 }
27642764
2765+#if FF_API_NEW_STREAM
27652766 AVStream *av_new_stream(AVFormatContext *s, int id)
2767+{
2768+ AVStream *st = avformat_new_stream(s, NULL);
2769+ if (st)
2770+ st->id = id;
2771+ return st;
2772+}
2773+#endif
2774+
2775+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)
27662776 {
27672777 AVStream *st;
27682778 int i;
@@ -2783,13 +2793,12 @@ AVStream *av_new_stream(AVFormatContext *s, int id) · 14 unmodified lines
27832793 return NULL;
27842794 }
27852795
2786− st->codec = avcodec_alloc_context3(NULL);
2796+ st->codec = avcodec_alloc_context3(c);
27872797 if (s->iformat) {
27882798 /* no default bitrate if decoding */
27892799 st->codec->bit_rate = 0;
27902800 }
27912801 st->index = s->nb_streams;
2792− st->id = id;
27932802 st->start_time = AV_NOPTS_VALUE;
27942803 st->duration = AV_NOPTS_VALUE;
27952804 /* we set the current DTS to 0 so that formats without any timestamps
libavformat/vc1test.c+1−1
@@ -54,7 +54,7 @@ static int vc1t_read_header(AVFormatContext *s, · 53 unmodified lines
5454 return -1;
5555
5656 /* init video codec */
57− st = av_new_stream(s, 0);
57+ st = avformat_new_stream(s, NULL);
5858 if (!st)
5959 return -1;
6060
libavformat/version.h+5−2
@@ -24,8 +24,8 @@ · 23 unmodified lines
2424 #include "libavutil/avutil.h"
2525
2626 #define LIBAVFORMAT_VERSION_MAJOR 53
27−#define LIBAVFORMAT_VERSION_MINOR 16
28−#define LIBAVFORMAT_VERSION_MICRO 1
27+#define LIBAVFORMAT_VERSION_MINOR 17
28+#define LIBAVFORMAT_VERSION_MICRO 0
2929
3030 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3131 LIBAVFORMAT_VERSION_MINOR, \
@@ -98,5 +98,8 @@ · 66 unmodified lines
9898 #ifndef FF_API_RTSP_URL_OPTIONS
9999 #define FF_API_RTSP_URL_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 54)
100100 #endif
101+#ifndef FF_API_NEW_STREAM
102+#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54)
103+#endif
101104
102105 #endif /* AVFORMAT_VERSION_H */
libavformat/vocdec.c+1−1
@@ -52,7 +52,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) · 51 unmodified lines
5252 return AVERROR(ENOSYS);
5353 }
5454 avio_skip(pb, header_size);
55− st = av_new_stream(s, 0);
55+ st = avformat_new_stream(s, NULL);
5656 if (!st)
5757 return AVERROR(ENOMEM);
5858 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/vqf.c+1−1
@@ -64,7 +64,7 @@ static void add_metadata(AVFormatContext *s, const char *tag, · 63 unmodified lines
6464 static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
6565 {
6666 VqfContext *c = s->priv_data;
67− AVStream *st = av_new_stream(s, 0);
67+ AVStream *st = avformat_new_stream(s, NULL);
6868 int chunk_tag;
6969 int rate_flag = -1;
7070 int header_size;
libavformat/wav.c+2−2
@@ -280,7 +280,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st) · 279 unmodified lines
280280 int ret;
281281
282282 /* parse fmt header */
283− *st = av_new_stream(s, 0);
283+ *st = avformat_new_stream(s, NULL);
284284 if (!*st)
285285 return AVERROR(ENOMEM);
286286
@@ -726,7 +726,7 @@ static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap) · 439 unmodified lines
726726 return -1;
727727 }
728728
729− st = av_new_stream(s, 0);
729+ st = avformat_new_stream(s, NULL);
730730 if (!st)
731731 return AVERROR(ENOMEM);
732732
libavformat/wc3movie.c+2−2
@@ -163,7 +163,7 @@ static int wc3_read_header(AVFormatContext *s, · 162 unmodified lines
163163 } while (fourcc_tag != BRCH_TAG);
164164
165165 /* initialize the decoder streams */
166− st = av_new_stream(s, 0);
166+ st = avformat_new_stream(s, NULL);
167167 if (!st)
168168 return AVERROR(ENOMEM);
169169 av_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
@@ -174,7 +174,7 @@ static int wc3_read_header(AVFormatContext *s, · 4 unmodified lines
174174 st->codec->width = wc3->width;
175175 st->codec->height = wc3->height;
176176
177− st = av_new_stream(s, 0);
177+ st = avformat_new_stream(s, NULL);
178178 if (!st)
179179 return AVERROR(ENOMEM);
180180 av_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
libavformat/westwood.c+3−3
@@ -144,7 +144,7 @@ static int wsaud_read_header(AVFormatContext *s, · 143 unmodified lines
144144 wsaud->audio_bits = (((header[10] & 0x2) >> 1) + 1) * 8;
145145
146146 /* initialize the audio decoder stream */
147− st = av_new_stream(s, 0);
147+ st = avformat_new_stream(s, NULL);
148148 if (!st)
149149 return AVERROR(ENOMEM);
150150 av_set_pts_info(st, 33, 1, wsaud->audio_samplerate);
@@ -221,7 +221,7 @@ static int wsvqa_read_header(AVFormatContext *s, · 70 unmodified lines
221221 unsigned int chunk_size;
222222
223223 /* initialize the video decoder stream */
224− st = av_new_stream(s, 0);
224+ st = avformat_new_stream(s, NULL);
225225 if (!st)
226226 return AVERROR(ENOMEM);
227227 av_set_pts_info(st, 33, 1, VQA_FRAMERATE);
@@ -247,7 +247,7 @@ static int wsvqa_read_header(AVFormatContext *s, · 19 unmodified lines
247247
248248 /* initialize the audio decoder stream for VQA v1 or nonzero samplerate */
249249 if (AV_RL16(&header[24]) || (AV_RL16(&header[0]) == 1 && AV_RL16(&header[2]) == 1)) {
250− st = av_new_stream(s, 0);
250+ st = avformat_new_stream(s, NULL);
251251 if (!st)
252252 return AVERROR(ENOMEM);
253253 av_set_pts_info(st, 33, 1, VQA_FRAMERATE);
libavformat/wtvdec.c+3−2
@@ -414,7 +414,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length) · 413 unmodified lines
414414 if (!filesize)
415415 goto done;
416416
417− st = av_new_stream(s, 0);
417+ st = avformat_new_stream(s, NULL);
418418 if (!st)
419419 goto done;
420420 av_dict_set(&st->metadata, "title", description, 0);
@@ -562,9 +562,10 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code · 141 unmodified lines
562562 WtvStream *wst = av_mallocz(sizeof(WtvStream));
563563 if (!wst)
564564 return NULL;
565− st = av_new_stream(s, sid);
565+ st = avformat_new_stream(s, NULL);
566566 if (!st)
567567 return NULL;
568+ st->id = sid;
568569 st->priv_data = wst;
569570 }
570571 st->codec->codec_type = codec_type;
libavformat/wv.c+1−1
@@ -220,7 +220,7 @@ static int wv_read_header(AVFormatContext *s, · 219 unmodified lines
220220 }
221221
222222 /* now we are ready: build format streams */
223− st = av_new_stream(s, 0);
223+ st = avformat_new_stream(s, NULL);
224224 if (!st)
225225 return -1;
226226 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/xa.c+1−1
@@ -70,7 +70,7 @@ static int xa_read_header(AVFormatContext *s, · 69 unmodified lines
7070 AVStream *st;
7171
7272 /*Set up the XA Audio Decoder*/
73− st = av_new_stream(s, 0);
73+ st = avformat_new_stream(s, NULL);
7474 if (!st)
7575 return AVERROR(ENOMEM);
7676
libavformat/xmv.c+2−2
@@ -147,7 +147,7 @@ static int xmv_read_header(AVFormatContext *s, · 146 unmodified lines
147147
148148 /* Video track */
149149
150− vst = av_new_stream(s, 0);
150+ vst = avformat_new_stream(s, NULL);
151151 if (!vst)
152152 return AVERROR(ENOMEM);
153153
@@ -202,7 +202,7 @@ static int xmv_read_header(AVFormatContext *s, · 48 unmodified lines
202202 av_log(s, AV_LOG_WARNING, "Unsupported 5.1 ADPCM audio stream "
203203 "(0x%04X)\n", packet->flags);
204204
205− ast = av_new_stream(s, audio_track);
205+ ast = avformat_new_stream(s, NULL);
206206 if (!ast)
207207 return AVERROR(ENOMEM);
208208
libavformat/xwma.c+1−1
@@ -69,7 +69,7 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) · 68 unmodified lines
6969 if (tag != MKTAG('f', 'm', 't', ' '))
7070 return -1;
7171 size = avio_rl32(pb);
72− st = av_new_stream(s, 0);
72+ st = avformat_new_stream(s, NULL);
7373 if (!st)
7474 return AVERROR(ENOMEM);
7575
libavformat/yop.c+2−2
@@ -56,8 +56,8 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) · 55 unmodified lines
5656
5757 int frame_rate, ret;
5858
59− audio_stream = av_new_stream(s, 0);
60− video_stream = av_new_stream(s, 1);
59+ audio_stream = avformat_new_stream(s, NULL);
60+ video_stream = avformat_new_stream(s, NULL);
6161
6262 // Extra data that will be passed to the decoder
6363 video_stream->codec->extradata_size = 8;
libavformat/yuv4mpeg.c+1−1
@@ -333,7 +333,7 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) · 332 unmodified lines
333333 aspectd = 1;
334334 }
335335
336− st = av_new_stream(s, 0);
336+ st = avformat_new_stream(s, NULL);
337337 if(!st)
338338 return AVERROR(ENOMEM);
339339 st->codec->width = width;
libavutil/opt.h+183−0
@@ -32,6 +32,189 @@ · 31 unmodified lines
3232 #include "dict.h"
3333 #include "log.h"
3434
35+/**
36+ * @defgroup avoptions AVOptions
37+ * @{
38+ * AVOptions provide a generic system to declare options on arbitrary structs
39+ * ("objects"). An option can have a help text, a type and a range of possible
40+ * values. Options may then be enumerated, read and written to.
41+ *
42+ * @section avoptions_implement Implementing AVOptions
43+ * This section describes how to add AVOptions capabilities to a struct.
44+ *
45+ * All AVOptions-related information is stored in an AVClass. Therefore
46+ * the first member of the struct must be a pointer to an AVClass describing it.
47+ * The option field of the AVClass must be set to a NULL-terminated static array
48+ * of AVOptions. Each AVOption must have a non-empty name, a type, a default
49+ * value and for number-type AVOptions also a range of allowed values. It must
50+ * also declare an offset in bytes from the start of the struct, where the field
51+ * associated with this AVOption is located. Other fields in the AVOption struct
52+ * should also be set when applicable, but are not required.
53+ *
54+ * The following example illustrates an AVOptions-enabled struct:
55+ * @code
56+ * typedef struct test_struct {
57+ * AVClass *class;
58+ * int int_opt;
59+ * char *str_opt;
60+ * uint8_t *bin_opt;
61+ * int bin_len;
62+ * } test_struct;
63+ *
64+ * static const AVOption options[] = {
65+ * { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
66+ * AV_OPT_TYPE_INT, { -1 }, INT_MIN, INT_MAX },
67+ * { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
68+ * AV_OPT_TYPE_STRING },
69+ * { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
70+ * AV_OPT_TYPE_BINARY },
71+ * { NULL },
72+ * };
73+ *
74+ * static const AVClass test_class = {
75+ * .class_name = "test class",
76+ * .item_name = av_default_item_name,
77+ * .option = options,
78+ * .version = LIBAVUTIL_VERSION_INT,
79+ * };
80+ * @endcode
81+ *
82+ * Next, when allocating your struct, you must ensure that the AVClass pointer
83+ * is set to the correct value. Then, av_opt_set_defaults() must be called to
84+ * initialize defaults. After that the struct is ready to be used with the
85+ * AVOptions API.
86+ *
87+ * When cleaning up, you may use the av_opt_free() function to automatically
88+ * free all the allocated string and binary options.
89+ *
90+ * Continuing with the above example:
91+ *
92+ * @code
93+ * test_struct *alloc_test_struct(void)
94+ * {
95+ * test_struct *ret = av_malloc(sizeof(*ret));
96+ * ret->class = &test_class;
97+ * av_opt_set_defaults(ret);
98+ * return ret;
99+ * }
100+ * void free_test_struct(test_struct **foo)
101+ * {
102+ * av_opt_free(*foo);
103+ * av_freep(foo);
104+ * }
105+ * @endcode
106+ *
107+ * @subsection avoptions_implement_nesting Nesting
108+ * It may happen that an AVOptions-enabled struct contains another
109+ * AVOptions-enabled struct as a member (e.g. AVCodecContext in
110+ * libavcodec exports generic options, while its priv_data field exports
111+ * codec-specific options). In such a case, it is possible to set up the
112+ * parent struct to export a child's options. To do that, simply
113+ * implement AVClass.child_next() and AVClass.child_class_next() in the
114+ * parent struct's AVClass.
115+ * Assuming that the test_struct from above now also contains a
116+ * child_struct field:
117+ *
118+ * @code
119+ * typedef struct child_struct {
120+ * AVClass *class;
121+ * int flags_opt;
122+ * } child_struct;
123+ * static const AVOption child_opts[] = {
124+ * { "test_flags", "This is a test option of flags type.",
125+ * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX },
126+ * { NULL },
127+ * };
128+ * static const AVClass child_class = {
129+ * .class_name = "child class",
130+ * .item_name = av_default_item_name,
131+ * .option = child_opts,
132+ * .version = LIBAVUTIL_VERSION_INT,
133+ * };
134+ *
135+ * void *child_next(void *obj, void *prev)
136+ * {
137+ * test_struct *t = obj;
138+ * if (!prev && t->child_struct)
139+ * return t->child_struct;
140+ * return NULL
141+ * }
142+ * const AVClass child_class_next(const AVClass *prev)
143+ * {
144+ * return prev ? NULL : &child_class;
145+ * }
146+ * @endcode
147+ * Putting child_next() and child_class_next() as defined above into
148+ * test_class will now make child_struct's options accessible through
149+ * test_struct (again, proper setup as described above needs to be done on
150+ * child_struct right after it is created).
151+ *
152+ * From the above example it might not be clear why both child_next()
153+ * and child_class_next() are needed. The distinction is that child_next()
154+ * iterates over actually existing objects, while child_class_next()
155+ * iterates over all possible child classes. E.g. if an AVCodecContext
156+ * was initialized to use a codec which has private options, then its
157+ * child_next() will return AVCodecContext.priv_data and finish
158+ * iterating. OTOH child_class_next() on AVCodecContext.av_class will
159+ * iterate over all available codecs with private options.
160+ *
161+ * @subsection avoptions_implement_named_constants Named constants
162+ * It is possible to create named constants for options. Simply set the unit
163+ * field of the option the constants should apply to to a string and
164+ * create the constants themselves as options of type AV_OPT_TYPE_CONST
165+ * with their unit field set to the same string.
166+ * Their default_val field should contain the value of the named
167+ * constant.
168+ * For example, to add some named constants for the test_flags option
169+ * above, put the following into the child_opts array:
170+ * @code
171+ * { "test_flags", "This is a test option of flags type.",
172+ * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, "test_unit" },
173+ * { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { 16 }, 0, 0, "test_unit" },
174+ * @endcode
175+ *
176+ * @section avoptions_use Using AVOptions
177+ * This section deals with accessing options in an AVOptions-enabled struct.
178+ * Such structs in Libav are e.g. AVCodecContext in libavcodec or
179+ * AVFormatContext in libavformat.
180+ *
181+ * @subsection avoptions_use_examine Examining AVOptions
182+ * The basic functions for examining options are av_opt_next(), which iterates
183+ * over all options defined for one object, and av_opt_find(), which searches
184+ * for an option with the given name.
185+ *
186+ * The situation is more complicated with nesting. An AVOptions-enabled struct
187+ * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
188+ * to av_opt_find() will make the function search children recursively.
189+ *
190+ * For enumerating there are basically two cases. The first is when you want to
191+ * get all options that may potentially exist on the struct and its children
192+ * (e.g. when constructing documentation). In that case you should call
193+ * av_opt_child_class_next() recursively on the parent struct's AVClass. The
194+ * second case is when you have an already initialized struct with all its
195+ * children and you want to get all options that can be actually written or read
196+ * from it. In that case you should call av_opt_child_next() recursively (and
197+ * av_opt_next() on each result).
198+ *
199+ * @subsection avoptions_use_get_set Reading and writing AVOptions
200+ * When setting options, you often have a string read directly from the
201+ * user. In such a case, simply passing it to av_opt_set() is enough. For
202+ * non-string type options, av_opt_set() will parse the string according to the
203+ * option type.
204+ *
205+ * Similarly av_opt_get() will read any option type and convert it to a string
206+ * which will be returned. Do not forget that the string is allocated, so you
207+ * have to free it with av_free().
208+ *
209+ * In some cases it may be more convenient to put all options into an
210+ * AVDictionary and call av_opt_set_dict() on it. A specific case of this
211+ * are the format/codec open functions in lavf/lavc which take a dictionary
212+ * filled with option as a parameter. This allows to set some options
213+ * that cannot be set otherwise, since e.g. the input file format is not known
214+ * before the file is actually opened.
215+ * @}
216+ */
217+
35218 enum AVOptionType{
36219 AV_OPT_TYPE_FLAGS,
37220 AV_OPT_TYPE_INT,
presets/libvpx-1080p.ffpresetrenamed from ffpresets/libvpx-1080p.avpreset+0−0

File renamed without changes.

presets/libvpx-1080p50_60.ffpresetrenamed from ffpresets/libvpx-1080p50_60.avpreset+0−0

File renamed without changes.

presets/libvpx-360p.ffpresetrenamed from ffpresets/libvpx-360p.avpreset+0−0

File renamed without changes.

presets/libvpx-720p.ffpresetrenamed from ffpresets/libvpx-720p.avpreset+0−0

File renamed without changes.

presets/libvpx-720p50_60.ffpresetrenamed from ffpresets/libvpx-720p50_60.avpreset+0−0

File renamed without changes.

presets/libx264-baseline.ffpreset+1−0
@@ -0,0 +1 @@
1+profile=baseline
presets/libx264-fast.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=fast
presets/libx264-fast_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=fast
2+fastfirstpass=1
presets/libx264-faster.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=faster
presets/libx264-faster_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=faster
2+fastfirstpass=1
presets/libx264-ipod320.ffpreset+4−0
@@ -0,0 +1,4 @@
1+profile=baseline
2+level=13
3+maxrate=768000
4+bufsize=3000000
presets/libx264-ipod640.ffpreset+4−0
@@ -0,0 +1,4 @@
1+profile=baseline
2+level=30
3+maxrate=10000000
4+bufsize=10000000
presets/libx264-lossless_fast.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=fast
2+qp=0
presets/libx264-lossless_max.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=placebo
2+qp=0
presets/libx264-lossless_medium.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=medium
2+qp=0
presets/libx264-lossless_slow.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=slow
2+qp=0
presets/libx264-lossless_slower.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=slower
2+qp=0
presets/libx264-lossless_ultrafast.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=ultrafast
2+qp=0
presets/libx264-main.ffpreset+1−0
@@ -0,0 +1 @@
1+profile=main
presets/libx264-medium.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=medium
presets/libx264-medium_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=medium
2+fastfirstpass=1
presets/libx264-placebo.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=placebo
presets/libx264-placebo_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=placebo
2+fastfirstpass=1
presets/libx264-slow.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=slow
presets/libx264-slow_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=slow
2+fastfirstpass=1
presets/libx264-slower.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=slower
presets/libx264-slower_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=slower
2+fastfirstpass=1
presets/libx264-superfast.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=superfast
presets/libx264-superfast_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=superfast
2+fastfirstpass=1
presets/libx264-ultrafast.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=ultrafast
presets/libx264-ultrafast_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=ultrafast
2+fastfirstpass=1
presets/libx264-veryfast.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=veryfast
presets/libx264-veryfast_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=veryfast
2+fastfirstpass=1
presets/libx264-veryslow.ffpreset+1−0
@@ -0,0 +1 @@
1+preset=veryslow
presets/libx264-veryslow_firstpass.ffpreset+2−0
@@ -0,0 +1,2 @@
1+preset=veryslow
2+fastfirstpass=1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t