Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 24506)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -1992,6 +1992,8 @@
 		$url = $attachment['url'];
 		if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url )
 			$rel = ' rel="attachment wp-att-' . $id . '"';
+		if ( empty( $html ) )
+			$html = ! empty( $post->post_title ) ? $post->post_title : basename( esc_url( $url ) );
 		$html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
 	}
 
@@ -2004,7 +2006,7 @@
 		$caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
 		$title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
 		$html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
-	} elseif ( 'video' === substr( $post->post_mime_type, 0, 5 ) || 'audio' === substr( $post->post_mime_type, 0, 5 )  ) {
+	} elseif ( empty( $html ) && ( 'video' === substr( $post->post_mime_type, 0, 5 ) || 'audio' === substr( $post->post_mime_type, 0, 5 ) ) ) {
 		$html = stripslashes_deep( $_POST['html'] );
 	}
 
