2017-02-25 23:40 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003876MPDMPDpublic2017-01-10 23:11
Reporterdensky 
Assigned Tocirrus 
PrioritylowSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
Platformi686 GNU/LinuxOSDebian 7.2OS Version3.2.0-4-686-pae
Product Version0.18 
Target VersionFixed in Versiongit 
Summary0003876: FFMPEG: Not enough buffer size for probe flac files
DescriptionFlac file can not be added to collection.
Debug messages follows

Nov 20 14:49 : ffmpeg/flac: Stream #0: not enough frames to estimate rate; consider increasing probesize
Nov 20 14:49 : ffmpeg/flac: Could not find codec parameters for stream 0 (Audio: flac, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Steps To ReproduceGrab some file from "pbthal vinyl pack - part 01" - "pbthal vinyl pack - part 06" and add it to music_directory in mpd.conf

File does not appear in "Artist/Album/Song", it only available in "Browse" menu of client.
Additional InformationAttached patch for quick fix. Hardcoded 'analyzeduration' and 'probesize' options in FfmpegDecoderPlugin.cxx to 8000000.

It would be nice to have the ffmpeg options available via mpd.conf
TagsNo tags attached.
Attached Files
  • patch file icon mpd-0.18.4.probesize.patch (2,355 bytes) 2013-11-22 05:17 -
    --- mpd/src/decoder/FfmpegDecoderPlugin.cxx.bak	2013-11-22 09:15:00.357819897 +0700
    +++ mpd/src/decoder/FfmpegDecoderPlugin.cxx	2013-11-22 09:28:38.696071964 +0700
    @@ -138,6 +138,9 @@
     	return io != nullptr;
     }
     
    +// Fix for "ffmpeg/flac: Stream #0: not enough frames to estimate rate; consider increasing probesize"
    +AVDictionary *av_options = NULL;
    +
     /**
      * API compatibility wrapper for av_open_input_stream() and
      * avformat_open_input().
    @@ -154,7 +157,9 @@
     
     	context->pb = pb;
     	*ic_ptr = context;
    -	return avformat_open_input(ic_ptr, filename, fmt, nullptr);
    +	av_dict_set(&av_options, "analyzeduration", "8000000", 0);
    +	av_dict_set(&av_options, "probesize", "8000000", 0);
    +	return avformat_open_input(ic_ptr, filename, fmt, &av_options);
     }
     
     static bool
    @@ -393,6 +398,7 @@
     	if (find_result < 0) {
     		LogError(ffmpeg_domain, "Couldn't find stream info");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -400,6 +406,7 @@
     	if (audio_stream == -1) {
     		LogError(ffmpeg_domain, "No audio stream inside");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -415,6 +422,7 @@
     	if (!codec) {
     		LogError(ffmpeg_domain, "Unsupported audio codec");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -431,6 +439,7 @@
     				       codec_context->channels, error)) {
     		LogError(error);
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -443,6 +452,7 @@
     	if (open_result < 0) {
     		LogError(ffmpeg_domain, "Could not open codec");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -457,6 +467,7 @@
     	if (!frame) {
     		LogError(ffmpeg_domain, "Could not allocate frame");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -505,6 +516,7 @@
     
     	avcodec_close(codec_context);
     	avformat_close_input(&format_context);
    +	av_dict_free(&av_options);
     }
     
     //no tag reading in ffmpeg, check if playable
    @@ -529,6 +541,7 @@
     		avformat_find_stream_info(f, nullptr);
     	if (find_result < 0) {
     		avformat_close_input(&f);
    +		av_dict_free(&av_options);
     		return false;
     	}
     
    @@ -543,6 +556,7 @@
     				       handler, handler_ctx);
     
     	avformat_close_input(&f);
    +	av_dict_free(&av_options);
     	return true;
     }
     
    
    patch file icon mpd-0.18.4.probesize.patch (2,355 bytes) 2013-11-22 05:17 +
  • patch file icon mpd-0.18.4.probesize-01.patch (2,365 bytes) 2013-11-25 06:50 -
    --- mpd/src/decoder/FfmpegDecoderPlugin.cxx.orig	2013-11-22 09:15:00.357819897 +0700
    +++ mpd/src/decoder/FfmpegDecoderPlugin.cxx	2013-11-25 12:28:17.227563644 +0700
    @@ -138,6 +138,10 @@
     	return io != nullptr;
     }
     
    +// Fix for "ffmpeg/flac: Stream #0: not enough frames to estimate rate; consider increasing probesize"
    +static
    +AVDictionary *av_options = NULL;
    +
     /**
      * API compatibility wrapper for av_open_input_stream() and
      * avformat_open_input().
    @@ -154,7 +158,9 @@
     
     	context->pb = pb;
     	*ic_ptr = context;
    -	return avformat_open_input(ic_ptr, filename, fmt, nullptr);
    +	av_dict_set(&av_options, "analyzeduration", "8000000", 0);
    +	av_dict_set(&av_options, "probesize", "8000000", 0);
    +	return avformat_open_input(ic_ptr, filename, fmt, &av_options);
     }
     
     static bool
    @@ -393,6 +399,7 @@
     	if (find_result < 0) {
     		LogError(ffmpeg_domain, "Couldn't find stream info");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -400,6 +407,7 @@
     	if (audio_stream == -1) {
     		LogError(ffmpeg_domain, "No audio stream inside");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -415,6 +423,7 @@
     	if (!codec) {
     		LogError(ffmpeg_domain, "Unsupported audio codec");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -431,6 +440,7 @@
     				       codec_context->channels, error)) {
     		LogError(error);
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -443,6 +453,7 @@
     	if (open_result < 0) {
     		LogError(ffmpeg_domain, "Could not open codec");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -457,6 +468,7 @@
     	if (!frame) {
     		LogError(ffmpeg_domain, "Could not allocate frame");
     		avformat_close_input(&format_context);
    +		av_dict_free(&av_options);
     		return;
     	}
     
    @@ -505,6 +517,7 @@
     
     	avcodec_close(codec_context);
     	avformat_close_input(&format_context);
    +	av_dict_free(&av_options);
     }
     
     //no tag reading in ffmpeg, check if playable
    @@ -529,6 +542,7 @@
     		avformat_find_stream_info(f, nullptr);
     	if (find_result < 0) {
     		avformat_close_input(&f);
    +		av_dict_free(&av_options);
     		return false;
     	}
     
    @@ -543,6 +557,7 @@
     				       handler, handler_ctx);
     
     	avformat_close_input(&f);
    +	av_dict_free(&av_options);
     	return true;
     }
     
    
    patch file icon mpd-0.18.4.probesize-01.patch (2,365 bytes) 2013-11-25 06:50 +

-Relationships
+Relationships

-Notes

~0008054

cirrus (administrator)

The patch is not acceptable because it adds a non-static global variable.

~0008059

densky (reporter)

Correct one

~0010259

cirrus (administrator)

142fdc8d86d26ebf478d87fc751181fd578e8c70
+Notes

-Issue History
Date Modified Username Field Change
2013-11-22 05:17 densky New Issue
2013-11-22 05:17 densky File Added: mpd-0.18.4.probesize.patch
2013-11-24 09:53 cirrus Note Added: 0008054
2013-11-25 06:49 densky Note Added: 0008059
2013-11-25 06:50 densky File Added: mpd-0.18.4.probesize-01.patch
2017-01-10 23:11 cirrus Assigned To => cirrus
2017-01-10 23:11 cirrus Status new => resolved
2017-01-10 23:11 cirrus Resolution open => fixed
2017-01-10 23:11 cirrus Fixed in Version => git
2017-01-10 23:11 cirrus Note Added: 0010259
+Issue History