History

Make av_get_channel_layout_string() guess the number of channels if it was not provided.

Originally committed as revision 26324 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 15 years ago

Commit 8b69c2f1 parent caeb0c33 files · +5 −1Browse files

Unified · Split

3 files
  1. libavcore/audioconvert.c +3 −0
  2. libavcore/audioconvert.h +1 −0
  3. libavcore/avcore.h +1 −1
libavcore/audioconvert.c+3−0
@@ -78,6 +78,9 @@ void av_get_channel_layout_string(char *buf, int buf_size, · 77 unmodified lines
7878 {
7979 int i;
8080
81+ if (nb_channels <= 0)
82+ nb_channels = av_get_channel_layout_nb_channels(channel_layout);
83+
8184 for (i = 0; channel_layout_map[i].name; i++)
8285 if (nb_channels == channel_layout_map[i].nb_channels &&
8386 channel_layout == channel_layout_map[i].layout) {
libavcore/audioconvert.h+1−0
@@ -80,6 +80,7 @@ int64_t av_get_channel_layout(const char *name); · 79 unmodified lines
8080
8181 /**
8282 * Return a description of a channel layout.
83+ * If nb_channels is <= 0, it is guessed from the channel_layout.
8384 *
8485 * @param buf put here the string containing the channel layout
8586 * @param buf_size size in bytes of the buffer
libavcore/avcore.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828
2929 #define LIBAVCORE_VERSION_MAJOR 0
3030 #define LIBAVCORE_VERSION_MINOR 16
31−#define LIBAVCORE_VERSION_MICRO 0
31+#define LIBAVCORE_VERSION_MICRO 1
3232
3333 #define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \
3434 LIBAVCORE_VERSION_MINOR, \

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