Also simplify the code so it's the same for video/audio/subs.
---
 avconv.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/avconv.c b/avconv.c
index 3ba8534..b30dad4 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1738,6 +1738,8 @@ static int transcode_video(InputStream *ist, AVPacket 
*pkt, int *got_output, int
                                 decoded_frame, got_output, pkt);
     if (ret < 0)
         goto fail;
+    pkt->data += ret;
+    pkt->size -= ret;
 
     quality = same_quant ? decoded_frame->quality : 0;
     if (!*got_output) {
@@ -1818,11 +1820,10 @@ static int transcode_subtitles(InputStream *ist, 
AVPacket *pkt, int *got_output)
                                           &subtitle, got_output, pkt);
     if (ret < 0)
         return ret;
+    pkt->size = 0;
     if (!*got_output)
         return 0;
 
-    pkt->size = 0;
-
     rate_emu_sleep(ist);
 
     for (i = 0; i < nb_output_streams; i++) {
@@ -1892,12 +1893,9 @@ static int output_packet(InputStream *ist, int ist_index,
         if (ret < 0)
             return ret;
         if (!got_output) {
-            if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-                continue;
-            goto discard_packet;
+            continue;
         }
     }
- discard_packet:
 
     /* handle stream copy */
     if (!ist->decoding_needed) {
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to