I'd suggest that their weak sales has something to do with the fact that their phones are ridiculously overpriced. Samsung seems to think that they're the 'Apple' of Android phones and that they can price their offerings accordingly. Look at their Galaxy S4 Mini and just announced S5 Mini models: mid-range devices (both have only 1.5GB RAM) with flagship prices.
Then there's Samsung's "budget" phones. They also just announced the Galaxy Ace 4. The most obvious difference from last year's Ace 3? They cut the RAM in half, from 1GB to 512MB. That's right, they actually made the specs worse. Maybe we should thank them for not making the processor slower, too (they both have 1GHz dual-cores).
Meanwhile, we've hit the point of having very decent Android phones from the competition available for $100 or less purchased outright (see LG Optimus F6). The S4 Mini, now a year old, is still running $300+ purchased outright. Why would the average buyer spend an extra $200 for incremental upgrades like an 8MP camera vs 5MP, 1.5GB of RAM instead of 1GB?
Samsung's had a great run, but I think we're seeing the beginning of the end, with the competition nipping at their ankles.