In transcoding, move frame output into its own function
In transcoding, move frame output into its own function

This function was already getting very long and complex,
and we'll soon be moving it into two more for loops.

This also fixes a bug where output packets from the
encoder thread (with --sout-transcode-threads larger than zero)
could get lost, since we could extract the output blocks twice
and thus overwrite the output parameter.

Signed-off-by: Rémi Denis-Courmont <f0699137713be92736351a0674e79536595e4a60@remlab.net>

vlc-mirror/vlc-2.1,shyamalschandra/vlc,shyamalschandra/vlc,vlc-mirror/vlc-2.1,krichter722/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.1,jomanmuk/vlc-2.1,krichter722/vlc,vlc-mirror/vlc,xkfz007/vlc,krichter722/vlc,jomanmuk/vlc-2.2,shyamalschandra/vlc,krichter722/vlc,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.2,xkfz007/vlc,jomanmuk/vlc-2.2,krichter722/vlc,vlc-mirror/vlc,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.2,shyamalschandra/vlc,vlc-mirror/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.1,jomanmuk/vlc-2.2,jomanmuk/vlc-2.2,vlc-mirror/vlc-2.1,vlc-mirror/vlc,jomanmuk/vlc-2.2,vlc-mirror/vlc-2.1,vlc-mirror/vlc,krichter722/vlc,xkfz007/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.1,shyamalschandra/vlc,xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,jomanmuk/vlc-2.1