summaryrefslogtreecommitdiffstats
path: root/libhb/muxavformat.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-03-18 16:40:11 +0000
committerjstebbins <[email protected]>2014-03-18 16:40:11 +0000
commit59805e78efe93f18e6874c9258fa22a308b4134b (patch)
tree3f098b26f380a50d55ccf2375d447708cc0b939f /libhb/muxavformat.c
parentd51206be7b8317d495885e20b846feb93463217d (diff)
muxavformat: only do style processing of mp4 text subtitles
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6119 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r--libhb/muxavformat.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
index d3c2cf56f..dea825fc2 100644
--- a/libhb/muxavformat.c
+++ b/libhb/muxavformat.c
@@ -1128,30 +1128,34 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
}
track->duration = pts;
}
- uint8_t styleatom[2048];;
- uint16_t stylesize = 0;
- uint8_t buffer[2048];
- uint16_t buffersize = 0;
-
- *buffer = '\0';
-
- /*
- * Copy the subtitle into buffer stripping markup and creating
- * style atoms for them.
- */
- hb_muxmp4_process_subtitle_style( buf->data,
- buffer,
- styleatom, &stylesize );
-
- buffersize = strlen((char*)buffer);
-
- /* Write the subtitle sample */
- memcpy( tx3g_out + 2, buffer, buffersize );
- memcpy( tx3g_out + 2 + buffersize, styleatom, stylesize);
- tx3g_out[0] = ( buffersize >> 8 ) & 0xff;
- tx3g_out[1] = buffersize & 0xff;
- pkt.data = tx3g_out;
- pkt.size = buffersize + stylesize + 2;
+ if (track->st->codec->codec_id == AV_CODEC_ID_MOV_TEXT ||
+ track->st->codec->codec_id == AV_CODEC_ID_TEXT)
+ {
+ uint8_t styleatom[2048];;
+ uint16_t stylesize = 0;
+ uint8_t buffer[2048];
+ uint16_t buffersize = 0;
+
+ *buffer = '\0';
+
+ /*
+ * Copy the subtitle into buffer stripping markup and creating
+ * style atoms for them.
+ */
+ hb_muxmp4_process_subtitle_style( buf->data,
+ buffer,
+ styleatom, &stylesize );
+
+ buffersize = strlen((char*)buffer);
+
+ /* Write the subtitle sample */
+ memcpy( tx3g_out + 2, buffer, buffersize );
+ memcpy( tx3g_out + 2 + buffersize, styleatom, stylesize);
+ tx3g_out[0] = ( buffersize >> 8 ) & 0xff;
+ tx3g_out[1] = buffersize & 0xff;
+ pkt.data = tx3g_out;
+ pkt.size = buffersize + stylesize + 2;
+ }
}
pkt.convergence_duration = pkt.duration;