mpegts: remove uneeded buf_size check

It is already ensured by the loop condition

Signed-off-by: Marton Balint <cus@passwd.hu>
mpegts: only emit new packets if data buffer exists

I don't think this can acutally happen in the current code, but better safe
than sorry.

Fixes Coverity CID 732217.

Signed-off-by: Marton Balint <cus@passwd.hu>
mpegts: fix indentation after last commit

Signed-off-by: Marton Balint <cus@passwd.hu>
mpegts: factorize pes packet state reset function

Signed-off-by: Marton Balint <cus@passwd.hu>
mpegts: unref buffer in reset_pes_packet_state

Signed-off-by: Marton Balint <cus@passwd.hu>
mpegts: always reset pes packet state on new packet

Fixes ticket #3584.

Signed-off-by: Marton Balint <cus@passwd.hu>
Merge remote-tracking branch 'cus/stable'

* cus/stable:
  mpegts: always reset pes packet state on new packet
  mpegts: unref buffer in reset_pes_packet_state
  mpegts: factorize pes packet state reset function
  mpegts: fix indentation after last commit
  mpegts: only emit new packets if data buffer exists
  mpegts: remove uneeded buf_size check

Merged-by: Michael Niedermayer <michaelni@gmx.at>