3 @@ -15825,9 +15825,9 @@
4 cat >>confdefs.h <<_ACEOF
5 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_open_input_file in -lavformat" >&5
8 -$as_echo_n "checking for av_open_input_file in -lavformat... " >&6; }
9 -if ${ac_cv_lib_avformat_av_open_input_file+:} false; then :
10 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avformat_open_input in -lavformat" >&5
11 +$as_echo_n "checking for avformat_open_input in -lavformat... " >&6; }
12 +if ${ac_cv_lib_avformat_avformat_open_input+:} false; then :
13 $as_echo_n "(cached) " >&6
15 ac_check_lib_save_LIBS=$LIBS
16 @@ -15841,27 +15841,27 @@
20 -char av_open_input_file ();
21 +char avformat_open_input ();
25 -return av_open_input_file ();
26 +return avformat_open_input ();
31 if ac_fn_c_try_link "$LINENO"; then :
32 - ac_cv_lib_avformat_av_open_input_file=yes
33 + ac_cv_lib_avformat_avformat_open_input=yes
35 - ac_cv_lib_avformat_av_open_input_file=no
36 + ac_cv_lib_avformat_avformat_open_input=no
38 rm -f core conftest.err conftest.$ac_objext \
39 conftest$ac_exeext conftest.$ac_ext
40 LIBS=$ac_check_lib_save_LIBS
42 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_open_input_file" >&5
43 -$as_echo "$ac_cv_lib_avformat_av_open_input_file" >&6; }
44 -if test "x$ac_cv_lib_avformat_av_open_input_file" = xyes; then :
45 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_avformat_open_input" >&5
46 +$as_echo "$ac_cv_lib_avformat_avformat_open_input" >&6; }
47 +if test "x$ac_cv_lib_avformat_avformat_open_input" = xyes; then :
48 for ac_header in libavcodec/avcodec.h ffmpeg/avcodec.h
50 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
51 diff -Naur sox-14.4.0-orig/src/ffmpeg.c sox-14.4.0/src/ffmpeg.c
52 --- sox-14.4.0-orig/src/ffmpeg.c 2012-06-12 00:35:53.459027469 -0400
53 +++ sox-14.4.0/src/ffmpeg.c 2012-06-12 00:36:26.539028545 -0400
55 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
56 enc->error_resilience = 1;
58 - enc->error_recognition = 1;
59 + enc->err_recognition = 1;
62 if (!codec || avcodec_open(enc, codec) < 0)
64 static int startread(sox_format_t * ft)
66 priv_t * ffmpeg = (priv_t *)ft->priv;
67 - AVFormatParameters params;
68 + AVDictionary *params;
74 /* Open file and get format */
75 memset(¶ms, 0, sizeof(params));
76 - if ((ret = av_open_input_file(&ffmpeg->ctxt, ft->filename, NULL, 0, ¶ms)) < 0) {
77 + if ((ret = avformat_open_input(&ffmpeg->ctxt, ft->filename, NULL, ¶ms)) < 0) {
78 lsx_fail("ffmpeg cannot open file for reading: %s (code %d)", ft->filename, ret);
82 /* If input buffer empty, read more data */
83 if (ffmpeg->audio_buf_index * 2 >= ffmpeg->audio_buf_size) {
84 if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 &&
85 - (ret == AVERROR_EOF || url_ferror(ffmpeg->ctxt->pb)))
86 + (ret == AVERROR_EOF || ffmpeg->ctxt->pb->error))
88 ffmpeg->audio_buf_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE);
89 ffmpeg->audio_buf_index = 0;
94 - /* set the output parameters (must be done even if no
96 - if (av_set_parameters(ffmpeg->ctxt, NULL) < 0) {
97 - lsx_fail("ffmpeg invalid output format parameters");
101 /* Next line for debugging */
102 /* dump_format(ffmpeg->ctxt, 0, ft->filename, 1); */
104 @@ -391,14 +384,14 @@
106 /* open the output file, if needed */
107 if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) {
108 - if (url_fopen(&ffmpeg->ctxt->pb, ft->filename, URL_WRONLY) < 0) {
109 + if (avio_open(&ffmpeg->ctxt->pb, ft->filename, AVIO_FLAG_WRITE) < 0) {
110 lsx_fail("ffmpeg could not open `%s'", ft->filename);
115 /* write the stream header, if any */
116 - av_write_header(ffmpeg->ctxt);
117 + avformat_write_header(ffmpeg->ctxt, NULL);
122 #if (LIBAVFORMAT_VERSION_INT < 0x340000)
123 url_fclose(&ffmpeg->ctxt->pb);
125 - url_fclose(ffmpeg->ctxt->pb);
126 + avio_close(ffmpeg->ctxt->pb);