View | Details | Raw Unified | Return to bug 239971
Collapse All | Expand All

(-)b/libffmpegthumbnailer/moviedecoder.cpp (-3 / +12 lines)
Lines 299-307 void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, int size, b Link Here
299
299
300
    AVFilterContext* rotateFilter = nullptr;
300
    AVFilterContext* rotateFilter = nullptr;
301
    auto rotation = getStreamRotation();
301
    auto rotation = getStreamRotation();
302
    if (rotation != -1)
302
    if (rotation == 3)
303
    {
303
    {
304
        checkRc(avfilter_graph_create_filter(&rotateFilter, avfilter_get_by_name("transpose"), "thumb_rotate", std::to_string(rotation).c_str(), nullptr, m_pFilterGraph),
304
        checkRc(avfilter_graph_create_filter(&rotateFilter, avfilter_get_by_name("rotate"), "thumb_rotate", "PI", nullptr, m_pFilterGraph),
305
            "Failed to create rotate filter");
306
    }
307
    else if (rotation != -1)
308
    {
309
        checkRc(avfilter_graph_create_filter(&rotateFilter, avfilter_get_by_name("transpose"), "thumb_transpose", std::to_string(rotation).c_str(), nullptr, m_pFilterGraph),
305
            "Failed to create rotate filter");
310
            "Failed to create rotate filter");
306
    }
311
    }
307
312
Lines 515-521 int32_t MovieDecoder::getStreamRotation() Link Here
515
    if (matrix)
520
    if (matrix)
516
    {
521
    {
517
        auto angle = lround(av_display_rotation_get(matrix));
522
        auto angle = lround(av_display_rotation_get(matrix));
518
        if (angle > 45 && angle < 135)
523
        if (angle < -135)
524
        {
525
            return 3;
526
        }
527
        else if (angle > 45 && angle < 135)
519
        {
528
        {
520
            return 2;
529
            return 2;
521
        }
530
        }

Return to bug 239971