[bTSstream-devel] [Git][videolan/bitstream][master] mpga: consider stereo and joint stereo the same
Massiot
gitlab at videolan.org
Mon Feb 20 23:50:14 CET 2017
Massiot pushed to branch master at videolan / bitstream
Commits:
981a3f4d by Christophe Massiot at 2017-02-20T23:49:39+01:00
mpga: consider stereo and joint stereo the same
Beucase encoders can switch on the fly.
- - - - -
1 changed file:
- mpeg/mpga.h
Changes:
=====================================
mpeg/mpga.h
=====================================
--- a/mpeg/mpga.h
+++ b/mpeg/mpga.h
@@ -214,10 +214,15 @@ static inline bool mpga_sync_compare(const uint8_t *p_mpga1, const uint8_t *p_mp
/* same but only takes into account meaningful fields */
static inline bool mpga_sync_compare_formats(const uint8_t *p_mpga1, const uint8_t *p_mpga2)
{
+ /* consider stereo and joint stereo the same - because encoders can
+ * switch on the fly */
+ uint8_t i_mode1 = mpga_get_mode(p_mpga1);
+ uint8_t i_mode2 = mpga_get_mode(p_mpga2);
+ if (i_mode1 == MPGA_MODE_JOINT) i_mode1 = MPGA_MODE_STEREO;
+ if (i_mode2 == MPGA_MODE_JOINT) i_mode2 = MPGA_MODE_STEREO;
return p_mpga1[0] == p_mpga2[0] &&
(p_mpga1[1] & 0xfe) == (p_mpga2[1] & 0xfe) &&
- (p_mpga1[2] & 0xfc) == (p_mpga2[2] & 0xfc) &&
- (p_mpga1[3] & 0xc0) == (p_mpga2[3] & 0xc0);
+ (p_mpga1[2] & 0xfc) == (p_mpga2[2] & 0xfc) && i_mode1 == i_mode2;
}
#ifdef __cplusplus
View it on GitLab: https://code.videolan.org/videolan/bitstream/commit/981a3f4dd2f946bb492cb0a0d412b81b26aad586
More information about the biTStream-devel
mailing list