diff --git a/mythplugins/mytharchive/mytharchive/thumbfinder.cpp b/mythplugins/mytharchive/mytharchive/thumbfinder.cpp
index 786dea5..94c7db0 100644
a
|
b
|
bool ThumbFinder::getFrameImage(bool needKeyFrame, int64_t requiredPTS) |
831 | 831 | m_firstIFramePTS = pkt.dts; |
832 | 832 | |
833 | 833 | av_frame_unref(m_frame); |
834 | | avcodec_decode_video2(m_codecCtx, m_frame, &frameFinished, &pkt); |
835 | | |
| 834 | frameFinished = 0; |
| 835 | int ret = avcodec_receive_frame(m_codecCtx, m_frame); |
| 836 | if (ret == 0) |
| 837 | frameFinished = 1; |
| 838 | if (ret == 0 || ret == AVERROR(EAGAIN)) |
| 839 | ret = avcodec_send_packet(m_codecCtx, &pkt); |
836 | 840 | if (requiredPTS != -1 && pkt.dts != (int64_t)AV_NOPTS_VALUE && pkt.dts < requiredPTS) |
837 | 841 | frameFinished = false; |
838 | 842 | |
diff --git a/mythplugins/mytharchive/mytharchivehelper/main.cpp b/mythplugins/mytharchive/mytharchivehelper/main.cpp
index 5734295..cb795d4 100644
a
|
b
|
static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int |
1660 | 1660 | |
1661 | 1661 | avcodec_flush_buffers(codecCtx); |
1662 | 1662 | av_frame_unref(frame); |
1663 | | avcodec_decode_video2(codecCtx, frame, &frameFinished, &pkt); |
| 1663 | frameFinished = 0; |
| 1664 | ret = avcodec_receive_frame(codecCtx, frame); |
| 1665 | if (ret == 0) |
| 1666 | frameFinished = 1; |
| 1667 | if (ret == 0 || ret == AVERROR(EAGAIN)) |
| 1668 | ret = avcodec_send_packet(codecCtx, &pkt); |
1664 | 1669 | keyFrame = frame->key_frame; |
1665 | 1670 | |
1666 | 1671 | while (!frameFinished || !keyFrame) |
… |
… |
static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int |
1673 | 1678 | { |
1674 | 1679 | frameNo++; |
1675 | 1680 | av_frame_unref(frame); |
1676 | | avcodec_decode_video2(codecCtx, frame, &frameFinished, &pkt); |
| 1681 | ret = avcodec_receive_frame(codecCtx, frame); |
| 1682 | if (ret == 0) |
| 1683 | frameFinished = 1; |
| 1684 | if (ret == 0 || ret == AVERROR(EAGAIN)) |
| 1685 | ret = avcodec_send_packet(codecCtx, &pkt); |
1677 | 1686 | keyFrame = frame->key_frame; |
1678 | 1687 | } |
1679 | 1688 | } |
… |
… |
static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int |
1730 | 1739 | if (pkt.stream_index == videostream) |
1731 | 1740 | { |
1732 | 1741 | frameNo++; |
1733 | | avcodec_decode_video2(codecCtx, frame, |
1734 | | &frameFinished, |
1735 | | &pkt); |
| 1742 | ret = avcodec_receive_frame(codecCtx, frame); |
| 1743 | if (ret == 0) |
| 1744 | frameFinished = 1; |
| 1745 | if (ret == 0 || ret == AVERROR(EAGAIN)) |
| 1746 | ret = avcodec_send_packet(codecCtx, &pkt); |
1736 | 1747 | } |
1737 | 1748 | } |
1738 | 1749 | } |