summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-06-06 21:24:20 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-06-06 21:24:20 +0000
commiteae3a6a3c2558cebe27bf73d0208ae12ee7e1537 (patch)
tree0b40d490310de2435f14de65ce8f399c359a7112
parente8c94d898ddd164ca644063c12d14f760832d408 (diff)
downloadrockbox-eae3a6a3c2558cebe27bf73d0208ae12ee7e1537.tar.gz
rockbox-eae3a6a3c2558cebe27bf73d0208ae12ee7e1537.zip
Assumption about there being MPEG1-only samplerates available and therefore MPEG1-only bitrates for recording is no longer valid. Fix that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13579 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/enc_config.c16
-rw-r--r--firmware/export/enc_base.h10
2 files changed, 19 insertions, 7 deletions
diff --git a/apps/enc_config.c b/apps/enc_config.c
index 3323c8dd94..c916b295df 100644
--- a/apps/enc_config.c
+++ b/apps/enc_config.c
@@ -134,7 +134,7 @@ static bool mp3_enc_bitrate(struct menucallback_data *data)
134 /* mono only */ 134 /* mono only */
135 { "16 kBit/s", TALK_ID(16, UNIT_KBIT) }, /* 2 */ 135 { "16 kBit/s", TALK_ID(16, UNIT_KBIT) }, /* 2 */
136 { "24 kBit/s", TALK_ID(24, UNIT_KBIT) }, /* 2 */ 136 { "24 kBit/s", TALK_ID(24, UNIT_KBIT) }, /* 2 */
137#endif 137#endif /* HAVE_MPEG2_SAMPR */
138 /* stereo/mono */ 138 /* stereo/mono */
139 { "32 kBit/s", TALK_ID(32, UNIT_KBIT) }, /* 1,2 */ 139 { "32 kBit/s", TALK_ID(32, UNIT_KBIT) }, /* 1,2 */
140 { "40 kBit/s", TALK_ID(40, UNIT_KBIT) }, /* 1,2 */ 140 { "40 kBit/s", TALK_ID(40, UNIT_KBIT) }, /* 1,2 */
@@ -145,16 +145,19 @@ static bool mp3_enc_bitrate(struct menucallback_data *data)
145 { "96 kBit/s", TALK_ID(96, UNIT_KBIT) }, /* 1,2 */ 145 { "96 kBit/s", TALK_ID(96, UNIT_KBIT) }, /* 1,2 */
146 { "112 kBit/s", TALK_ID(112, UNIT_KBIT) }, /* 1,2 */ 146 { "112 kBit/s", TALK_ID(112, UNIT_KBIT) }, /* 1,2 */
147 { "128 kBit/s", TALK_ID(128, UNIT_KBIT) }, /* 1,2 */ 147 { "128 kBit/s", TALK_ID(128, UNIT_KBIT) }, /* 1,2 */
148#if 0 148 /* Leave out 144 when there is both MPEG 1 and 2 */
149#if defined(HAVE_MPEG2_SAMPR) && !defined (HAVE_MPEG1_SAMPR)
149 /* oddball MPEG2-only rate stuck in the middle */ 150 /* oddball MPEG2-only rate stuck in the middle */
150 { "144 kBit/s", TALK_ID(144, UNIT_KBIT) }, /* 2 */ 151 { "144 kBit/s", TALK_ID(144, UNIT_KBIT) }, /* 2 */
151#endif 152#endif
152 { "160 kBit/s", TALK_ID(160, UNIT_KBIT) }, /* 1,2 */ 153 { "160 kBit/s", TALK_ID(160, UNIT_KBIT) }, /* 1,2 */
154#ifdef HAVE_MPEG1_SAMPR
153 /* stereo only */ 155 /* stereo only */
154 { "192 kBit/s", TALK_ID(192, UNIT_KBIT) }, /* 1 */ 156 { "192 kBit/s", TALK_ID(192, UNIT_KBIT) }, /* 1 */
155 { "224 kBit/s", TALK_ID(224, UNIT_KBIT) }, /* 1 */ 157 { "224 kBit/s", TALK_ID(224, UNIT_KBIT) }, /* 1 */
156 { "256 kBit/s", TALK_ID(256, UNIT_KBIT) }, /* 1 */ 158 { "256 kBit/s", TALK_ID(256, UNIT_KBIT) }, /* 1 */
157 { "320 kBit/s", TALK_ID(320, UNIT_KBIT) }, /* 1 */ 159 { "320 kBit/s", TALK_ID(320, UNIT_KBIT) }, /* 1 */
160#endif
158 }; 161 };
159 162
160 unsigned long rate_list[ARRAYLEN(items)]; 163 unsigned long rate_list[ARRAYLEN(items)];
@@ -163,10 +166,17 @@ static bool mp3_enc_bitrate(struct menucallback_data *data)
163 storing and maintaining yet another list of numbers */ 166 storing and maintaining yet another list of numbers */
164 int n_rates = make_list_from_caps32( 167 int n_rates = make_list_from_caps32(
165 MPEG1_BITR_CAPS | MPEG2_BITR_CAPS, mp3_enc_bitr, 168 MPEG1_BITR_CAPS | MPEG2_BITR_CAPS, mp3_enc_bitr,
166 MPEG1_BITR_CAPS 169 0
170#ifdef HAVE_MPEG1_SAMPR
171 | MPEG1_BITR_CAPS
172#endif
167#ifdef HAVE_MPEG2_SAMPR 173#ifdef HAVE_MPEG2_SAMPR
174#ifdef HAVE_MPEG1_SAMPR
168 | (MPEG2_BITR_CAPS & ~(MP3_BITR_CAP_144 | MP3_BITR_CAP_8)) 175 | (MPEG2_BITR_CAPS & ~(MP3_BITR_CAP_144 | MP3_BITR_CAP_8))
176#else
177 | (MPEG2_BITR_CAPS & ~(MP3_BITR_CAP_8))
169#endif 178#endif
179#endif /* HAVE_MPEG2_SAMPR */
170 , rate_list); 180 , rate_list);
171 181
172 int index = round_value_to_list32(cfg->mp3_enc.bitrate, rate_list, 182 int index = round_value_to_list32(cfg->mp3_enc.bitrate, rate_list,
diff --git a/firmware/export/enc_base.h b/firmware/export/enc_base.h
index e1baa2545a..a9eff523ce 100644
--- a/firmware/export/enc_base.h
+++ b/firmware/export/enc_base.h
@@ -75,15 +75,17 @@ struct aiff_enc_config
75#define MPEG2_5_BITR_CAPS MPEG2_BITR_CAPS 75#define MPEG2_5_BITR_CAPS MPEG2_BITR_CAPS
76#endif 76#endif
77 77
78/* Assume 44100 is always available and therefore MPEG1 */
79
80/* HAVE_MPEG* defines mainly apply to the bitrate menu */ 78/* HAVE_MPEG* defines mainly apply to the bitrate menu */
81#if (REC_SAMPR_CAPS & MPEG2_SAMPR_CAPS) || defined (HAVE_SPDIF_IN) 79#if (REC_SAMPR_CAPS & MPEG1_SAMPR_CAPS) || defined (HAVE_SPDIF_REC)
80#define HAVE_MPEG1_SAMPR
81#endif
82
83#if (REC_SAMPR_CAPS & MPEG2_SAMPR_CAPS) || defined (HAVE_SPDIF_REC)
82#define HAVE_MPEG2_SAMPR 84#define HAVE_MPEG2_SAMPR
83#endif 85#endif
84 86
85#if 0 87#if 0
86#if (REC_SAMPR_CAPS & MPEG2_5_SAMPR_CAPS) || defined (HAVE_SPDIF_IN) 88#if (REC_SAMPR_CAPS & MPEG2_5_SAMPR_CAPS) || defined (HAVE_SPDIF_REC)
87#define HAVE_MPEG2_5_SAMPR 89#define HAVE_MPEG2_5_SAMPR
88#endif 90#endif
89#endif /* 0 */ 91#endif /* 0 */