[Tex/LaTex] Alternating header in scrreprt with scrpage2

header-footerkoma-scriptscrpage2

I want to achieve the following:
In a twoside document I want to display the chapter title on even pages and the section (plus subsection if there is one) title on odd pages. So that for odd pages it looks like "section — subsection" if there is a subsection and "section" otherwise.
So far, I do it this way:

    \documentclass[a4paper, 12pt, twoside, openright, appendixprefix, BCOR7.5mm, pointlessnumbers, bibliography=totoc, listof=totoc]{scrreprt}
    \usepackage[utf8]{inputenc}
    \usepackage[american]{babel}
    \usepackage{blindtext}

    \usepackage{scrpage2}

    \begin{document}

    \pagestyle{scrheadings}
    \automark[subsection]{chapter}
    \renewcommand*{\sectionmark}[1]{%
        \markright{\ifnum \value{secnumdepth} >0 \sectionmarkformat\fi
        #1}}%
    \setheadsepline{.2pt}
    \ohead{\headmark}

    \chapter{Chapter 1}
    \section{section}
    \blindtext[15]

    \chapter{Chapter 2}
    \section{section}
    \subsection{subsection}
    \blindtext[15]

    \end{document}

This works so far in that it displays chapter and section OR subsections, respectively. Now I want to display both, section and subsection. How can I do this?
Thank you.

Edit: Added example.

Best Answer

Try this

 \documentclass[a4paper, 12pt, twoside, openright, appendixprefix, BCOR7.5mm, pointlessnumbers, bibliography=totoc, listof=totoc]{scrreprt}
    \usepackage[utf8]{inputenc}
    \usepackage[american]{babel}
    \usepackage{blindtext}
    \usepackage{extramarks}
    \usepackage{scrpage2}
    \newcommand\currentsectionmark{}
    \pagestyle{scrheadings}
    \automark[subsection]{chapter}

    \renewcommand*{\sectionmark}[1]{%
        \markright{\ifnum \value{secnumdepth} >0 \sectionmarkformat\fi
        #1}\def\currentsectionmark{\ifnum \value{secnumdepth} >0 \sectionmarkformat\fi
        #1}}%

    \renewcommand*\subsectionmark[1]{%
     \markright{\currentsectionmark\ -- \subsectionmarkformat #1}}    
    \setheadsepline{.2pt}
    \lehead{\leftmark}
    \rohead{\lastrightmark}

    \begin{document}


    \chapter{Chapter 1}
        blub
    \newpage
    blub
    \newpage
    \section{section}
    \section{section 2}
    \blindtext[15]

    \chapter{Chapter 2}
        blub
    \newpage
    blub
    \newpage
    \section{section}
    \section{section 2}
    \subsection{subsection}
    \blindtext[15]
    \chapter{Chapter 2}
    blub
    \newpage
    blub
    \newpage
    \section{section}
    \subsection{subsection}
    \section{section 2}
    \blindtext[15]

    \chapter{Chapter 2}
    blub
    \newpage
    blub
    \newpage
    \section{section}
    \newpage
    \subsection{subsection}
    \subsection{subsection 2}
    \blindtext[35]
    \end{document}