You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.2 KiB

  1. --- a/configure
  2. +++ b/configure
  3. @@ -15825,9 +15825,9 @@
  4. cat >>confdefs.h <<_ACEOF
  5. #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
  6. _ACEOF
  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
  14. else
  15. ac_check_lib_save_LIBS=$LIBS
  16. @@ -15841,27 +15841,27 @@
  17. #ifdef __cplusplus
  18. extern "C"
  19. #endif
  20. -char av_open_input_file ();
  21. +char avformat_open_input ();
  22. int
  23. main ()
  24. {
  25. -return av_open_input_file ();
  26. +return avformat_open_input ();
  27. ;
  28. return 0;
  29. }
  30. _ACEOF
  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
  34. else
  35. - ac_cv_lib_avformat_av_open_input_file=no
  36. + ac_cv_lib_avformat_avformat_open_input=no
  37. fi
  38. rm -f core conftest.err conftest.$ac_objext \
  39. conftest$ac_exeext conftest.$ac_ext
  40. LIBS=$ac_check_lib_save_LIBS
  41. fi
  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
  49. do :
  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
  54. @@ -93,7 +93,7 @@
  55. #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
  56. enc->error_resilience = 1;
  57. #else
  58. - enc->error_recognition = 1;
  59. + enc->err_recognition = 1;
  60. #endif
  61. if (!codec || avcodec_open(enc, codec) < 0)
  62. @@ -157,7 +157,7 @@
  63. static int startread(sox_format_t * ft)
  64. {
  65. priv_t * ffmpeg = (priv_t *)ft->priv;
  66. - AVFormatParameters params;
  67. + AVDictionary *params;
  68. int ret;
  69. int i;
  70. @@ -172,7 +172,7 @@
  71. /* Open file and get format */
  72. memset(&params, 0, sizeof(params));
  73. - if ((ret = av_open_input_file(&ffmpeg->ctxt, ft->filename, NULL, 0, &params)) < 0) {
  74. + if ((ret = avformat_open_input(&ffmpeg->ctxt, ft->filename, NULL, &params)) < 0) {
  75. lsx_fail("ffmpeg cannot open file for reading: %s (code %d)", ft->filename, ret);
  76. return SOX_EOF;
  77. }
  78. @@ -231,7 +231,7 @@
  79. /* If input buffer empty, read more data */
  80. if (ffmpeg->audio_buf_index * 2 >= ffmpeg->audio_buf_size) {
  81. if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 &&
  82. - (ret == AVERROR_EOF || url_ferror(ffmpeg->ctxt->pb)))
  83. + (ret == AVERROR_EOF || ffmpeg->ctxt->pb->error))
  84. break;
  85. ffmpeg->audio_buf_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE);
  86. ffmpeg->audio_buf_index = 0;
  87. @@ -373,13 +373,6 @@
  88. return SOX_EOF;
  89. }
  90. - /* set the output parameters (must be done even if no
  91. - parameters). */
  92. - if (av_set_parameters(ffmpeg->ctxt, NULL) < 0) {
  93. - lsx_fail("ffmpeg invalid output format parameters");
  94. - return SOX_EOF;
  95. - }
  96. -
  97. /* Next line for debugging */
  98. /* dump_format(ffmpeg->ctxt, 0, ft->filename, 1); */
  99. @@ -391,14 +384,14 @@
  100. /* open the output file, if needed */
  101. if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) {
  102. - if (url_fopen(&ffmpeg->ctxt->pb, ft->filename, URL_WRONLY) < 0) {
  103. + if (avio_open(&ffmpeg->ctxt->pb, ft->filename, AVIO_FLAG_WRITE) < 0) {
  104. lsx_fail("ffmpeg could not open `%s'", ft->filename);
  105. return SOX_EOF;
  106. }
  107. }
  108. /* write the stream header, if any */
  109. - av_write_header(ffmpeg->ctxt);
  110. + avformat_write_header(ffmpeg->ctxt, NULL);
  111. return SOX_SUCCESS;
  112. }
  113. @@ -478,7 +471,7 @@
  114. #if (LIBAVFORMAT_VERSION_INT < 0x340000)
  115. url_fclose(&ffmpeg->ctxt->pb);
  116. #else
  117. - url_fclose(ffmpeg->ctxt->pb);
  118. + avio_close(ffmpeg->ctxt->pb);
  119. #endif
  120. }