Signed-off-by: Paul B Mahol <onemda@gmail.com>
Paul B Mahol authored on 2017/01/20 04:42:14... | ... |
@@ -1861,13 +1861,8 @@ static av_cold int xma_decode_end(AVCodecContext *avctx) |
1861 | 1861 |
return 0; |
1862 | 1862 |
} |
1863 | 1863 |
|
1864 |
-/** |
|
1865 |
- *@brief Clear decoder buffers (for seeking). |
|
1866 |
- *@param avctx codec context |
|
1867 |
- */ |
|
1868 |
-static void flush(AVCodecContext *avctx) |
|
1864 |
+static void flush(WMAProDecodeCtx *s) |
|
1869 | 1865 |
{ |
1870 |
- WMAProDecodeCtx *s = avctx->priv_data; |
|
1871 | 1866 |
int i; |
1872 | 1867 |
/** reset output buffer as a part of it is used during the windowing of a |
1873 | 1868 |
new frame */ |
... | ... |
@@ -1875,6 +1870,30 @@ static void flush(AVCodecContext *avctx) |
1875 | 1875 |
memset(s->channel[i].out, 0, s->samples_per_frame * |
1876 | 1876 |
sizeof(*s->channel[i].out)); |
1877 | 1877 |
s->packet_loss = 1; |
1878 |
+ s->skip_packets = 0; |
|
1879 |
+} |
|
1880 |
+ |
|
1881 |
+ |
|
1882 |
+/** |
|
1883 |
+ *@brief Clear decoder buffers (for seeking). |
|
1884 |
+ *@param avctx codec context |
|
1885 |
+ */ |
|
1886 |
+static void wmapro_flush(AVCodecContext *avctx) |
|
1887 |
+{ |
|
1888 |
+ WMAProDecodeCtx *s = avctx->priv_data; |
|
1889 |
+ |
|
1890 |
+ flush(s); |
|
1891 |
+} |
|
1892 |
+ |
|
1893 |
+static void xma_flush(AVCodecContext *avctx) |
|
1894 |
+{ |
|
1895 |
+ XMADecodeCtx *s = avctx->priv_data; |
|
1896 |
+ int i; |
|
1897 |
+ for (i = 0; i < (avctx->channels + 1) / 2; i++) |
|
1898 |
+ flush(&s->xma[i]); |
|
1899 |
+ |
|
1900 |
+ memset(s->offset, 0, sizeof(s->offset)); |
|
1901 |
+ s->current_stream = 0; |
|
1878 | 1902 |
} |
1879 | 1903 |
|
1880 | 1904 |
|
... | ... |
@@ -1891,7 +1910,7 @@ AVCodec ff_wmapro_decoder = { |
1891 | 1891 |
.close = wmapro_decode_end, |
1892 | 1892 |
.decode = wmapro_decode_packet, |
1893 | 1893 |
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, |
1894 |
- .flush = flush, |
|
1894 |
+ .flush = wmapro_flush, |
|
1895 | 1895 |
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, |
1896 | 1896 |
AV_SAMPLE_FMT_NONE }, |
1897 | 1897 |
}; |
... | ... |
@@ -1919,6 +1938,7 @@ AVCodec ff_xma2_decoder = { |
1919 | 1919 |
.init = xma_decode_init, |
1920 | 1920 |
.close = xma_decode_end, |
1921 | 1921 |
.decode = xma_decode_packet, |
1922 |
+ .flush = xma_flush, |
|
1922 | 1923 |
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, |
1923 | 1924 |
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, |
1924 | 1925 |
AV_SAMPLE_FMT_NONE }, |